summaryrefslogtreecommitdiff
path: root/.github/workflows/container.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/container.yml')
-rw-r--r--.github/workflows/container.yml24
1 files changed, 22 insertions, 2 deletions
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 496130edc..6369f1b7a 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -121,6 +121,8 @@ jobs:
permissions:
# Organization GHCR
packages: write
+ # Clean key cache step
+ actions: write
outputs:
docker_tag: ${{ steps.build.outputs.docker_tag }}
@@ -144,8 +146,9 @@ jobs:
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local/"
- - name: Setup cache container mounts
- uses: actions/cache@v4
+ - name: Restore cache container mounts
+ id: cache-container-mounts
+ uses: actions/cache/restore@v4
with:
key: "container-mounts-${{ hashFiles('./container/*.dockerfile') }}"
restore-keys: "container-mounts-"
@@ -153,6 +156,14 @@ jobs:
/var/tmp/buildah-cache/
/var/tmp/buildah-cache-*/
+ # https://github.com/actions/cache/pull/1308
+ - if: steps.cache-container-mounts.outputs.cache-hit == 'true'
+ name: Clean key cache container mounts
+ continue-on-error: true
+ env:
+ GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
+ run: gh cache delete container-mounts-${{ hashFiles('./container/*.dockerfile') }}
+
- if: ${{ matrix.emulation }}
name: Setup QEMU
uses: docker/setup-qemu-action@v3
@@ -170,6 +181,15 @@ jobs:
OVERRIDE_ARCH: "${{ matrix.arch }}"
run: make podman.build
+ - if: always()
+ name: Save cache container mounts
+ uses: actions/cache/save@v4
+ with:
+ key: "container-mounts-${{ hashFiles('./container/*.dockerfile') }}"
+ path: |
+ /var/tmp/buildah-cache/
+ /var/tmp/buildah-cache-*/
+
test:
name: Test (${{ matrix.arch }})
runs-on: ${{ matrix.os }}