Skip to content

Push Docker images to ghcr on PR events & deduplicate Docker build logic#611

Merged
selenaliu1 merged 4 commits into
masterfrom
bek76/docker-ci
Nov 3, 2025
Merged

Push Docker images to ghcr on PR events & deduplicate Docker build logic#611
selenaliu1 merged 4 commits into
masterfrom
bek76/docker-ci

Conversation

@benkoppe

@benkoppe benkoppe commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Summary

The codebase already includes a ci-container.yml file, which builds a Docker image in CI on the pull_request event. However, these images are immediately lost upon being built. This PR indends to push these images to GitHub's container registry ghcr, such that PRs are more easily testable & deployable.

Additionally, this PR addresses the duplication of Docker build & push logic between cd-workflow.yml and ci-container.yml. This was already causing problems, as input build-args didn't match between the files and were missing the frontend google maps keys. Now, they are merged in a single workflow file, docker-build-push.yml, that is utilized in both workflows. I think this is the best way to go about doing this? Let me know.

  • ci-container.yml creates a github token with write access and pushes the Docker image to ghcr with tags and labels that indicate its status as a PR
    • NOTE: is the arrangements of tags and especially labels desirable when laid out as they are here? I think the tags make sense, as it ties them to the PR and also allows a specific build to be referenced by hash.
  • centralized Docker build & push login in a single reusable workflow. I followed these steps to extract the workflow.

@benkoppe benkoppe requested a review from a team as a code owner November 3, 2025 02:36
@dti-github-bot

Copy link
Copy Markdown
Member

[diff-counting] Significant lines: 80.

@selenaliu1 selenaliu1 merged commit 48fd1ba into master Nov 3, 2025
4 checks passed
@selenaliu1 selenaliu1 deleted the bek76/docker-ci branch November 3, 2025 02:40
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.

3 participants