Skip to content

chore: CI that checks every change and publishes the image to GHCR - #5

Merged
RohanReddy44 merged 5 commits into
mainfrom
chore/ci-image
Sep 24, 2026
Merged

RohanReddy44 merged 5 commits into
mainfrom
chore/ci-image

Conversation

@RohanReddy44

Copy link
Copy Markdown
Collaborator

What

One workflow, .github/workflows/ci.yml, in the same shape as the web client's, with no security scan:

check ──→ image   (main and release tags only)
  • check runs on every pull request, on pushes to main, and on release tags. It runs uv sync --locked, then ruff, ruff format, pyright, vulture and pytest.
  • image runs only after check passes, and never on a pull request. It builds the Dockerfile and pushes it to ghcr.io/openagrinet/experience-api, tagged with the ref (main or v1.2.0), the commit SHA, and latest.
    • It is labelled with org.opencontainers.image.source, so the package links to this repository.
    • It uses the workflow's own GITHUB_TOKEN with packages: write, so there's no secret to set up.
    • Cached layers are reused between runs.

This replaces run-tests.yml. The README says where to pull the image from.

Why

Every change is checked, and every change that reaches main becomes a deployable image.

Testing

  • actionlint passes on the workflow.
  • The Dockerfile is the one already built and run locally.
  • This PR runs check itself. image runs first when this merges to main.
  • If the org restricts workflow permissions, the GHCR push will be refused. The fix is Settings → Actions → Workflow permissions → Read and write.

🤖 Generated with Claude Code

- run-tests.yml becomes ci.yml, shaped like the web client's, ready for an image job.
- The check job runs every gate: lint, format, types, dead code, tests.
- Built only after every check passes; never on a pull request.
- Tagged with the ref, the commit and latest; labelled to link it to this repo.
- Pushed with the workflow's own token, so no secret needs setting up.
- workflow_dispatch runs check and publishes the chosen ref's image.
- Only main tags latest, so a manual branch run cannot replace what deploys pull.
@RohanReddy44
RohanReddy44 merged commit e01e1ba into main Sep 24, 2026
2 checks passed
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