Skip to content

Commit 3aab1de

Browse files
committed
ci: stabilize docker build cache
1 parent 5fef458 commit 3aab1de

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
# If not provided: when triggered by tag push, uses the tag automatically;
1818
# when called via workflow_call, defaults to the commit that triggered the workflow
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
2024
env:
2125
IMAGE_NAME_GHCR: ghcr.io/prizz/opencode-cloud-sandbox
2226
IMAGE_NAME_DOCKERHUB: ${{ vars.DOCKERHUB_USERNAME }}/opencode-cloud-sandbox
@@ -109,7 +113,7 @@ jobs:
109113
# Separate cache scope to avoid overwriting the main publish build cache.
110114
# GHA cache v2 is the recommended backend going forward.
111115
cache-from: type=gha,scope=opencode-cloud-sandbox-test,version=2
112-
cache-to: type=gha,scope=opencode-cloud-sandbox-test,mode=max,version=2
116+
cache-to: type=gha,scope=opencode-cloud-sandbox-test,mode=min,version=2
113117

114118
# Temporary disabled smoke test
115119
# - name: Smoke test - verify container starts and becomes healthy
@@ -194,8 +198,12 @@ jobs:
194198
labels: ${{ steps.meta.outputs.labels }}
195199
# Scoped cache prevents thrash between test and publish builds.
196200
# GHA cache v2 improves compatibility with the current cache API.
197-
cache-from: type=gha,scope=opencode-cloud-sandbox,version=2
198-
cache-to: type=gha,scope=opencode-cloud-sandbox,mode=max,version=2
201+
cache-from: |
202+
type=registry,ref=${{ env.IMAGE_NAME_GHCR }}:buildcache
203+
type=gha,scope=opencode-cloud-sandbox,version=2
204+
cache-to: |
205+
type=registry,ref=${{ env.IMAGE_NAME_GHCR }}:buildcache,mode=max
206+
type=gha,scope=opencode-cloud-sandbox,mode=min,version=2
199207
200208
- name: Update Docker Hub description
201209
uses: peter-evans/dockerhub-description@v5

.github/workflows/dockerfile-updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
file: packages/core/src/docker/Dockerfile
8888
push: false
8989
cache-from: type=gha,scope=opencode-cloud-dockerfile-updates,version=2
90-
cache-to: type=gha,scope=opencode-cloud-dockerfile-updates,mode=max,version=2
90+
cache-to: type=gha,scope=opencode-cloud-dockerfile-updates,mode=min,version=2
9191

9292
- name: Create Pull Request
9393
if: steps.check.outputs.updates_available == 'true'

0 commit comments

Comments
 (0)