Skip to content

ci(deploy): deploy pre-built images tagged by commit SHA - #2131

Open
alanpeixinho wants to merge 2 commits into
kernelci:mainfrom
profusion:chore/deploy-sha-images
Open

alanpeixinho wants to merge 2 commits into
kernelci:mainfrom
profusion:chore/deploy-sha-images

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What it is

Staging and production deploy pre-built GHCR images by commit SHA instead of :latest or on-server builds.

  • Publish GHCR Images — Manual ref; images tagged with resolved SHA; :latest only on push to main.
  • Staging — CI passes github.sha; pull + up --no-build; optional manual deploy with image_tag.
  • Production — Required image_tag (SHA); pulls that tag; DASHBOARD_VERSION from deployed commit.
  • Staging compose image paths match .env.example; docs updated.
    Do not run Deploy production Dashboard for this PR.

How to test

1. Publish (no staging, no prod)

  1. Push this branch.
  2. Repo ActionsPublish GHCR ImagesRun workflow.
  3. Use workflow from this branch. Set ref to this branch (required).
  4. Open the run → Summary: Commit SHA: <sha> is the commit you built.
  5. Confirm tags in GHCR (https://github.com/orgs/kernelci/packages):
  • dashboard-backend, dashboard-frontend, dashboard-proxy each have a tag equal to that full SHA.
  • On this manual run, the latest tag digest should be unchanged (compare digest before vs after).

2. Negative staging (no host change)

  1. ActionsDeploy Staging and E2ERun workflow from this branch (we cannot run this via UI until the PR is merged, so we need to run this action via cli with gh workflow run "Deploy Staging and E2E" \ --repo kernelci/dashboard \ --ref chore/deploy-sha-images \ -f image_tag=<commit tag from the published image>).
  2. Set image_tag to a fake SHA.
  3. Open the run → job check-migrations should fail on actions/checkout (ref not found).
  4. Job deploy-staging must not run (no SSH).

3. Manual staging (optional — live staging)

Same workflow as (2), image_tag = SHA from (1). This updates staging.

  1. Run Summary: Deploying staging with IMAGE_TAG=<sha>.
  2. Same Summary, table Staging deployment status, column Image:
  • ghcr.io/kernelci/dashboard/dashboard-backend:<sha>
  • same for dashboard-frontend and dashboard-proxy.
  1. Do not use the staging site version string; that is git describe, not the image tag.

4. After merge to main (live staging; existing CI behavior)

Two runs, same merge commit. Actions at https://github.com/kernelci/dashboard/actions.
CI

  1. Left: CI for KernelCI Dashboard.
  2. Open the run with event push (not pull_request). Title is the merge commit.
  3. Run header shows the commit SHA (github.sha).
  4. Jobs: call-deploy-staging / Deploy Staging and E2E must run (skipped = you opened the PR CI run).
  5. Open job deploy-staging → run Summary:
  • Deploying staging with IMAGE_TAG=<sha> equals the header SHA.
  • Staging deployment statusImage column uses …/dashboard-*: <same sha>, not :latest.
    Publish
  1. Left: Publish GHCR Images.
  2. Open the run for that same commit.
  3. Summary: Commit SHA: <sha> matches IMAGE_TAG from the CI staging job.
    Discord only fires if staging fails; success is Actions Summary only.

Closes #2087.

@alanpeixinho
alanpeixinho marked this pull request as ready for review September 22, 2026 21:12
* Publish GHCR Images: optional ref on manual dispatch; tag images with resolved commit SHA; push `latest` only on push to main
* Staging: required `image_tag`; pull GHCR images with `--no-build`; manual `workflow_dispatch`; CI passes `github.sha` after tests
* Production: required `image_tag` (replaces unused `tag` default); export `IMAGE_TAG` on deploy; checkout deploy SHA on server
* Align staging `docker-compose.yml` image paths with `IMAGE_OWNER` / `IMAGE_REPOSITORY` from `.env.example`
* Update DEPLOYMENT.md and README for SHA-based deploy flow

Closes kernelci#2087
@alanpeixinho
alanpeixinho force-pushed the chore/deploy-sha-images branch from e9a1955 to bfb9c73 Compare September 23, 2026 12:58

This branch has not been deployed

No deployments
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.

Improve Deployment Versioning and Ref Selection

1 participant