Skip to content

Commit

Permalink
ci: 添加 buildkit 缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Dec 28, 2024
1 parent a83f7e0 commit a993ae0
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ jobs:
type=semver,pattern={{version}}
type=ref,event=branch
- name: Cache buildkit
uses: actions/cache@v4
id: cache
with:
path: |
var-cache-apt
var-lib-apt
root-cache-uv
key: cache-${{ hashFiles('.github/workflows/test/Dockerfile') }}

- name: Inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"var-cache-apt": "/var/cache/apt",
"var-lib-apt": "/var/lib/apt",
"root-cache-uv": "/root/.cache/uv"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}

- name: Build and Publish
uses: docker/build-push-action@v6
with:
Expand Down Expand Up @@ -102,6 +123,27 @@ jobs:
type=semver,pattern={{version}}
type=ref,event=branch
- name: Cache buildkit
uses: actions/cache@v4
id: cache
with:
path: |
var-cache-apt
var-lib-apt
root-cache-uv
key: cache-${{ hashFiles('.github/workflows/test/Dockerfile') }}

- name: Inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"var-cache-apt": "/var/cache/apt",
"var-lib-apt": "/var/lib/apt",
"root-cache-uv": "/root/.cache/uv"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}

- name: Build and Publish
uses: docker/build-push-action@v6
with:
Expand Down

0 comments on commit a993ae0

Please sign in to comment.