修改缓存方式,加速每次构建

解决 The `save-state` command is deprecated
This commit is contained in:
rebecca554owen 2025-01-07 14:02:04 +08:00 committed by GitHub
parent c15bf63f2b
commit deb94222bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,11 +19,15 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Docker layer caching - name: Cache Docker layers
uses: satackey/action-docker-layer-caching@v0.0.11 uses: actions/cache@v4
continue-on-error: true with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Setup build environment - name: Setup build environment
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
@ -55,10 +59,17 @@ jobs:
context: . context: .
push: true push: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
tags: | tags: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/xboard:new ${{ env.REGISTRY }}/${{ github.repository_owner }}/xboard:new
${{ env.REGISTRY }}/${{ github.repository_owner }}/xboard:${{ steps.get_version.outputs.version }} ${{ env.REGISTRY }}/${{ github.repository_owner }}/xboard:${{ steps.get_version.outputs.version }}
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Install cosign - name: Install cosign
uses: sigstore/cosign-installer@v3.4.0 uses: sigstore/cosign-installer@v3.4.0
with: with: