Skip to content

Add GitHub Actions workflow to build and push backend Docker image#10

Merged
echska merged 1 commit into
mainfrom
codex/build-docker-image-for-backend
May 9, 2026
Merged

Add GitHub Actions workflow to build and push backend Docker image#10
echska merged 1 commit into
mainfrom
codex/build-docker-image-for-backend

Conversation

@echska
Copy link
Copy Markdown
Owner

@echska echska commented May 9, 2026

Motivation

  • Add CI to build and publish the backend Docker image to GitHub Container Registry when backend code on main changes or via manual trigger.

Description

  • Add .github/workflows/backend-docker.yml which checks out the repo, sets up Docker Buildx, logs into GHCR using GITHUB_TOKEN, extracts metadata with docker/metadata-action, and builds and pushes the image from parental-control-system/backend to ghcr.io/${{ github.repository_owner }}/parental-control-backend with sha and latest tags.

Testing

  • No automated tests were run as part of this PR; the new workflow is configured to run on push to main and via workflow_dispatch for manual verification.

Codex Task

@echska echska merged commit e58c805 into main May 9, 2026
0 of 2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af1c32efa6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +41 to +43
tags: |
type=sha
type=raw,value=latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate the latest tag to the main branch

Because this workflow can be started with workflow_dispatch, a user can run it against a non-main ref while this tag block still publishes latest. In that scenario, an ad-hoc build from a feature or older branch overwrites the production ghcr.io/.../parental-control-backend:latest image even though the push trigger is limited to main; only emit the latest tag when the selected ref is the default/main branch, or restrict manual dispatch accordingly.

Useful? React with 👍 / 👎.

Comment on lines +41 to +43
tags: |
type=sha
type=raw,value=latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent older runs from overwriting latest

When two pushes to main are close together, this workflow has no concurrency cancellation, so the slower, older build can finish after the newer one and republish latest to the older commit. Consumers that pull latest would then get a rollback even though a newer commit already built successfully; add a branch-scoped concurrency group with cancel-in-progress or avoid publishing the mutable tag from every run.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant