Skip to content

Commit

Permalink
Merge branch 'build-cache' into dependabot/pip/cryptography-42.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Feb 21, 2024
2 parents 850b062 + 49e6099 commit 93ec847
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/trigger-build-on-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Build and Publish to Registry on Github push
env:
GITHUB_SHA: ${{ github.sha }}
REGISTRY_HOSTNAME: docker.io
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}

on:
Expand All @@ -28,11 +26,13 @@ jobs:
echo ::set-output name=tag::${TAG}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
uses: docker/setup-buildx-action@v3

- name: Docker Login
run: |
echo "$DOCKER_PASSWORD" | docker login --username $DOCKER_USER --password-stdin
- name: Docker Hub Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Cache Docker layers
uses: actions/cache@v2
Expand All @@ -43,19 +43,10 @@ jobs:
${{ runner.os }}-single-buildx
- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ steps.prep.outputs.tagged_image }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 93ec847

Please sign in to comment.