Skip to content

fix(ci): skip build when image tag already exists (DASOPS-2157) - #1700

Merged
andersondario-er merged 1 commit into
developfrom
fix-DASOPS-2157-image-tag-immutability-skip
Aug 14, 2026
Merged

fix(ci): skip build when image tag already exists (DASOPS-2157)#1700
andersondario-er merged 1 commit into
developfrom
fix-DASOPS-2157-image-tag-immutability-skip

Conversation

@andersondario-er

Copy link
Copy Markdown
Contributor

Summary

Builds re-run for an already-built commit fail when pushing the immutable {branch}-{sha} image tag (cannot update tag ... The repository has enabled tag immutability). This adds a guard so an existing image is detected and the build/push is skipped, letting the deploy jobs reuse it.

Changes

Fixed

  • develop.yml and release.yml now check whether the target image tag already exists before building, and skip Build and push when it does. This mirrors the guard pr-envs.yml already uses, so all three workflows behave consistently on re-runs.

Technical Details

  • New Check if image already exists step runs gcloud artifacts docker images describe and sets an exists output; Build and push gains if: steps.image-check.outputs.exists != 'true'.
  • The image tag is keyed on the commit SHA and JS deps are locked (yarn --immutable), so an existing image is the same source — a skip is safe. The only residual edge is base-image drift over time, the same tradeoff already accepted for PR envs.
  • Removes the need for the empty-commit workaround when re-running a build.

Files Changed

2 files changed, 32 insertions(+)

  • .github/workflows/develop.yml
  • .github/workflows/release.yml

Jira: https://allenai.atlassian.net/browse/DASOPS-2157

Artifact Registry has tag immutability enabled, so re-running develop.yml
or release.yml for an already-built commit fails when pushing the same
{branch}-{sha} tag. Add a check-if-image-exists guard (already used by
pr-envs.yml) and gate the build/push step on it; downstream deploy jobs
reuse the existing image.
@andersondario-er andersondario-er self-assigned this Aug 14, 2026
@andersondario-er
andersondario-er merged commit a74c0d7 into develop Aug 14, 2026
6 of 7 checks passed
@andersondario-er
andersondario-er deleted the fix-DASOPS-2157-image-tag-immutability-skip branch August 14, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant