Skip to content

Commit

Permalink
Merge pull request #27 from startersclan/enhancement/ci-enhance-cachi…
Browse files Browse the repository at this point in the history
…ng-between-buildx-jobs

Enhancement (ci): Enhance caching between buildx jobs
  • Loading branch information
leojonathanoh authored Nov 2, 2023
2 parents 23b91ff + 07a8ca0 commit 5fa1215
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
key: ${{ runner.os }}-buildx-daemon-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-daemon-
${{ runner.os }}-buildx-
- name: Cache Docker layers (web)
uses: actions/cache@v3
Expand All @@ -41,6 +42,7 @@ jobs:
key: ${{ runner.os }}-buildx-web-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-web-
${{ runner.os }}-buildx-
- name: Print buildx and compose
run: |
Expand Down Expand Up @@ -97,7 +99,7 @@ jobs:
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
path: /tmp/.buildx-cache-${{ matrix.variant }}
key: ${{ runner.os }}-buildx-${{ matrix.variant }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.variant }}-
Expand Down Expand Up @@ -146,8 +148,8 @@ jobs:
platforms: linux/amd64
push: false
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
cache-from: type=local,src=/tmp/.buildx-cache-${{ matrix.variant }}
cache-to: type=local,dest=/tmp/.buildx-cache-${{ matrix.variant }}-new,mode=max

- name: Build and push
# Run on master and tags
Expand All @@ -159,16 +161,16 @@ jobs:
platforms: ${{ matrix.variant == 'daemon' && 'linux/amd64' || 'linux/386,linux/amd64,linux/arm64' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
cache-from: type=local,src=/tmp/.buildx-cache-${{ matrix.variant }}
cache-to: type=local,dest=/tmp/.buildx-cache-${{ matrix.variant }}-new,mode=max

# 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
rm -rf /tmp/.buildx-cache-${{ matrix.variant }}
mv /tmp/.buildx-cache-${{ matrix.variant }}-new /tmp/.buildx-cache-${{ matrix.variant }}
update-draft-release:
needs: [test, build]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ docker volume rm hlstatsx-community-edition-db-volume
## Release

```sh
./scripts/release.sh "1.2.3"
./release.sh "1.2.3"
git add .
git commit -m "Chore: Release 1.2.3"
```
Expand Down

0 comments on commit 5fa1215

Please sign in to comment.