Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement (ci): Enhance caching between buildx jobs #27

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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