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

try caching buildkit layers #45

Merged
merged 1 commit into from
Aug 26, 2023
Merged
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
24 changes: 22 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ jobs:
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=pr

- name: Rust Build Cache for Docker
uses: actions/cache@v3
with:
path: rust-build-cache
key: ${{ runner.os }}-build-cache-${{ hashFiles('**/Cargo.toml') }}

- name: inject rust-build-cache into docker
uses: overmindtech/buildkit-cache-dance/inject@main
with:
cache-source: rust-build-cache

- name: Docker login
uses: docker/login-action@v2
#if: github.event_name != 'pull_request'
Expand All @@ -51,13 +62,22 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
# when not using buildkit cache
#cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
#cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
# when using buildkit-cache-dance
cache-from: type=gha
cache-to: type=gha,mode=max
#push: ${{ github.ref == 'refs/heads/main' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ matrix.platform }}

- name: extract rust-build-cache from docker
uses: overmindtech/buildkit-cache-dance/extract@main
with:
cache-source: rust-build-cache

lint:
runs-on: ubuntu-latest
steps:
Expand Down