Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 49 additions & 8 deletions .github/workflows/docker-build-publish-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Check warning on line 28 in .github/workflows/docker-build-publish-demo.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (buildcache)
- 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 }}
Comment on lines +29 to +34

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Redundant GHCR login steps per job

Each of the three jobs now contains two identical docker/login-action@v4 calls for GHCR — the new one added before the build (lines 29–34 in gauzy-api, similar locations in the other two jobs) and the pre-existing one used before the final push (e.g., lines 92–97). The login-action writes credentials to Docker's credential store, which persists for the entire job, so the second call is a no-op. Since both use the same GITHUB_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!


- name: Build
uses: docker/build-push-action@v7
Expand All @@ -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.

Check warning on line 49 in .github/workflows/docker-build-publish-demo.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (buildcache)
# 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

Check warning on line 53 in .github/workflows/docker-build-publish-demo.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (buildcache)
type=registry,ref=ghcr.io/ever-co/gauzy-api-demo:latest

@augmentcode augmentcode Bot Jul 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In .github/workflows/docker-build-publish-demo.yml, cache-from: type=registry,ref=...:latest may stop being a useful fallback now that cache-to no longer exports type=inline, since the :latest image may not carry BuildKit cache metadata. If the :buildcache tag is missing/expired, this could lead to unexpectedly cold builds despite the "fallback" entry.

Severity: low

Other Locations
  • .github/workflows/docker-build-publish-demo.yml:154
  • .github/workflows/docker-build-publish-demo.yml:254

Fix This in Augment

🤖 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

Check warning on line 55 in .github/workflows/docker-build-publish-demo.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (buildcache)
build-args: |
NODE_ENV=development
DEMO=true
Expand Down Expand Up @@ -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).

Check warning on line 128 in .github/workflows/docker-build-publish-demo.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (buildcache)
- 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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading