-
Notifications
You must be signed in to change notification settings - Fork 786
ci(demo): registry mode=max build cache for ARC (fix ~3h cold builds) #9786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,8 +23,15 @@ | |
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v4 | ||
|
|
||
| # Log in to GHCR BEFORE the build so buildx can PUSH the mode=max layer cache to the | ||
| # :buildcache tag (cache-to needs registry auth at build time). | ||
| - name: Login to GitHub Container Registry (build cache) | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| driver: docker | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build | ||
| uses: docker/build-push-action@v7 | ||
|
|
@@ -38,8 +45,14 @@ | |
| everco/gauzy-api-demo:latest | ||
| registry.digitalocean.com/ever/gauzy-api-demo:latest | ||
| ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest | ||
| cache-from: type=registry,ref=ghcr.io/ever-co/gauzy-api-demo:latest | ||
| cache-to: type=inline | ||
| # mode=max caches ALL stages (incl. the multi-minute yarn-install layers) to a dedicated | ||
| # :buildcache tag; every ephemeral runner restores it → no more fully-cold rebuilds. | ||
| # Needs the default docker-container buildx driver — the classic `docker` driver only | ||
| # supports inline (final-stage) cache, which is why the yarn-install stages were cold. | ||
| cache-from: | | ||
| type=registry,ref=ghcr.io/ever-co/gauzy-api-demo:buildcache | ||
| type=registry,ref=ghcr.io/ever-co/gauzy-api-demo:latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Severity: low Other Locations
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| cache-to: type=registry,ref=ghcr.io/ever-co/gauzy-api-demo:buildcache,mode=max | ||
| build-args: | | ||
| NODE_ENV=development | ||
| DEMO=true | ||
|
|
@@ -111,6 +124,15 @@ | |
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v4 | ||
|
|
||
| # Log in to GHCR BEFORE the build so buildx can PUSH the mode=max layer cache to the | ||
| # :buildcache tag (cache-to needs registry auth at build time). | ||
| - name: Login to GitHub Container Registry (build cache) | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build | ||
| uses: docker/build-push-action@v7 | ||
| with: | ||
|
|
@@ -123,8 +145,14 @@ | |
| everco/gauzy-webapp-demo:latest | ||
| registry.digitalocean.com/ever/gauzy-webapp-demo:latest | ||
| ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest | ||
| cache-from: type=registry,ref=ghcr.io/ever-co/gauzy-webapp-demo:latest | ||
| cache-to: type=inline | ||
| # mode=max caches ALL stages (incl. the multi-minute yarn-install layers) to a dedicated | ||
| # :buildcache tag; every ephemeral runner restores it → no more fully-cold rebuilds. | ||
| # Needs the default docker-container buildx driver — the classic `docker` driver only | ||
| # supports inline (final-stage) cache, which is why the yarn-install stages were cold. | ||
| cache-from: | | ||
| type=registry,ref=ghcr.io/ever-co/gauzy-webapp-demo:buildcache | ||
| type=registry,ref=ghcr.io/ever-co/gauzy-webapp-demo:latest | ||
| cache-to: type=registry,ref=ghcr.io/ever-co/gauzy-webapp-demo:buildcache,mode=max | ||
| build-args: | | ||
| NODE_ENV=development | ||
| DEMO=true | ||
|
|
@@ -195,8 +223,15 @@ | |
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v4 | ||
|
|
||
| # Log in to GHCR BEFORE the build so buildx can PUSH the mode=max layer cache to the | ||
| # :buildcache tag (cache-to needs registry auth at build time). | ||
| - name: Login to GitHub Container Registry (build cache) | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| driver: docker | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build | ||
| uses: docker/build-push-action@v7 | ||
|
|
@@ -210,8 +245,14 @@ | |
| everco/gauzy-worker-demo:latest | ||
| registry.digitalocean.com/ever/gauzy-worker-demo:latest | ||
| ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-worker-demo:latest | ||
| cache-from: type=registry,ref=ghcr.io/ever-co/gauzy-worker-demo:latest | ||
| cache-to: type=inline | ||
| # mode=max caches ALL stages (incl. the multi-minute yarn-install layers) to a dedicated | ||
| # :buildcache tag; every ephemeral runner restores it → no more fully-cold rebuilds. | ||
| # Needs the default docker-container buildx driver — the classic `docker` driver only | ||
| # supports inline (final-stage) cache, which is why the yarn-install stages were cold. | ||
| cache-from: | | ||
| type=registry,ref=ghcr.io/ever-co/gauzy-worker-demo:buildcache | ||
| type=registry,ref=ghcr.io/ever-co/gauzy-worker-demo:latest | ||
| cache-to: type=registry,ref=ghcr.io/ever-co/gauzy-worker-demo:buildcache,mode=max | ||
| build-args: | | ||
| NODE_ENV=development | ||
| DEMO=true | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each of the three jobs now contains two identical
docker/login-action@v4calls for GHCR — the new one added before the build (lines 29–34 ingauzy-api, similar locations in the other two jobs) and the pre-existing one used before the final push (e.g., lines 92–97). Thelogin-actionwrites credentials to Docker's credential store, which persists for the entire job, so the second call is a no-op. Since both use the sameGITHUB_TOKEN, you can safely remove the later "Login to GitHub Container Registry" step in each job (or alternatively, drop the newly added one and move the existing one above the build step).Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!