Skip to content

Commit c328d23

Browse files
committed
ci: use registry cache backend for devcontainer
1 parent 5506c6d commit c328d23

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/build-devcontainer.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
run: |
2929
repo_lower=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')
3030
echo "name=ghcr.io/$repo_lower/devcontainer:latest" >> $GITHUB_OUTPUT
31+
echo "cache-ref=ghcr.io/$repo_lower/devcontainer:cache" >> $GITHUB_OUTPUT
3132
3233
- name: Set up Docker Buildx
3334
uses: docker/setup-buildx-action@v3
@@ -47,5 +48,5 @@ jobs:
4748
file: .devcontainer/Dockerfile
4849
push: ${{ github.event_name != 'pull_request' }}
4950
tags: ${{ steps.image.outputs.name }}
50-
cache-from: type=gha
51-
cache-to: type=gha,mode=max
51+
cache-from: type=registry,ref=${{ steps.image.outputs.cache-ref }}
52+
cache-to: type=registry,ref=${{ steps.image.outputs.cache-ref }},mode=max

.github/workflows/checks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ jobs:
9292
id: image
9393
run: |
9494
repo_lower=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')
95-
image="ghcr.io/$repo_lower/devcontainer:${{ github.sha }}"
96-
echo "name=$image" >> $GITHUB_OUTPUT
95+
echo "name=ghcr.io/$repo_lower/devcontainer:${{ github.sha }}" >> $GITHUB_OUTPUT
96+
echo "cache-ref=ghcr.io/$repo_lower/devcontainer:cache" >> $GITHUB_OUTPUT
9797
9898
- name: Build and push devcontainer image
9999
uses: docker/build-push-action@v6
@@ -102,8 +102,8 @@ jobs:
102102
file: .devcontainer/Dockerfile
103103
push: true
104104
tags: ${{ steps.image.outputs.name }}
105-
cache-from: type=gha
106-
cache-to: type=gha,mode=max
105+
cache-from: type=registry,ref=${{ steps.image.outputs.cache-ref }}
106+
cache-to: type=registry,ref=${{ steps.image.outputs.cache-ref }},mode=max
107107

108108
build-doc:
109109
name: Build and test documentation

0 commit comments

Comments
 (0)