ci: make Docker Hub push conditional on configured secrets - #9
Merged
Conversation
The Docker Build job failed on main with 'Username and password required' because DOCKERHUB_USERNAME/DOCKERHUB_TOKEN secrets are not configured in this repository. Detect credential availability in a gate step: with secrets, login and push multi-arch as before; without, run a build-only amd64 smoke test so the Dockerfile is still validated on every main push.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The post-merge
Docker Buildjob on main failed with Username and password required — theDOCKERHUB_USERNAME/DOCKERHUB_TOKENsecrets are not configured in this repository, anddocker/login-actionhard-fails when both are empty.This change adds a credential gate step:
linux/amd64,linux/arm64) exactly as beforelinux/amd64smoke test (no push), and note it in the job summaryThe Dockerfile keeps getting validated on every main push either way, and forks without secrets get green CI.
Test plan
DOCKERHUB_USERNAME/DOCKERHUB_TOKENin repo settings to re-enable image publishing