Skip to content

CD: publish images to GHCR, create Sentry releases, deploy to dev #10

Open

Description

@NinjaLikesCheez

Temporary routing (2026-10-08): Pull requests publish to GHCR and deploy that SHA to Azure dev. Merges to main deploy to prod. Prod is fail-closed until #12 / prod secrets exist. This overrides main → dev in the original body. Draft CD: #67. ADR 0010.

Context

CI already checks every PR: lint, type-check, tests with coverage, build and Docker build. CD now publishes images (PR 67). Azure dev apply (#9) is blocked on GHCR 401 until the package exists and is public.

Depends on #9 for the Container App itself. Prod stack is #12.

Goal (temporary)

  • PRs → ghcr.io/pixelbar/pixel:<sha> + deploy to Azure dev
  • main → same image toward prod (fail closed if Terraform/secrets are missing)
  • Original goal (main → dev, prod later with approval) is paused until this routing is reverted.

Scope

  • Publish images: ghcr.io/pixelbar/pixel tagged with the git SHA (and pr-<n> / moving main). The package is public, because the image holds no secrets
  • Deploy to dev from PRs: roll out the SHA, authenticating to Azure with OIDC (Terraform bootstrap: remote state and GitHub OIDC #8)
  • Deploy to prod from main: only when Prod environment, approval gate and go-live in the Pixelbar server #12 and prod Key Vault secrets exist; never copy the Mini/dev Discord token
  • Sentry release (still later): a release per deploy, with source maps uploaded so stack traces point at the TypeScript source
  • Command registration (still later): register slash commands as part of the deploy

Acceptance criteria

  • A PR SHA is pullable from GHCR (package public) and, once pixel-dev exists and ARM_* is set, that SHA is running on dev (one replica)
  • Merge to main publishes the SHA; prod deploy fails closed until Prod environment, approval gate and go-live in the Pixelbar server #12 / prod secrets exist
  • Verified that the image contains no .env, access lists, block list or other secrets
  • A failed deploy leaves the app on the previous working version, or rollback is one documented step
  • Workflow permissions stay minimal: only the publishing job can write packages
  • Actions pinned to commit SHAs, as in the existing CI
  • Sentry shows the release, and stack traces map to .ts files and lines (later)

Considerations

  • Provenance and SBOM for published images would be nice to have
  • Whether to register commands from CI or from the app on startup
  • Image tags: SHA pin plus moving pr-<n> / main; never latest as the only pin

Activity

  1. NinjaLikesCheez commented on Oct 8, 2026

    @NinjaLikesCheez
    ContributorAuthor

    Temporary routing (2026-10-08). Thomas asked to ship CD as:

    • PRs → ghcr.io/pixelbar/pixel:<sha> and Azure dev (pixel-dev, one replica)
    • main → prod (fail closed until infra/envs/prod / prod secrets exist)

    That overrides the main → dev goal in this issue. Draft: #67 (ADR 0010).

    Still later on this issue: Sentry releases + source maps, and just register from CD. GHCR auth is GITHUB_TOKEN on the publish job only (packages: write). Prod must not get the Mini/Pixel Dev Discord token.

  2. NinjaLikesCheez commented on Oct 8, 2026

    @NinjaLikesCheez
    ContributorAuthor

    Routing update: Azure dev is now a local build (just deploy-dev on the Mini), not PR CI — so you can test this tree without another CI head overwriting the one replica. main still publishes GHCR and is the prod release (fail closed until #12). Draft: #67.

  3. NinjaLikesCheez commented on Oct 8, 2026

    @NinjaLikesCheez
    ContributorAuthor

    Routing update: prod is not ready (#12), so CD on main no longer deploys to prod. Merges still publish ghcr.io/pixelbar/pixel:<sha> (package is already public). Azure dev stays just deploy-dev (one replica). Draft: #68.

    That PR also starts the next #10 slice: Sentry source maps + just register on deploy-dev. Releases skip until Thomas sets SENTRY_ORG / SENTRY_PROJECT / SENTRY_AUTH_TOKEN. ARM_* on Environment dev is still unset (Terraform plan skips). Do not copy the Mini/Pixel Dev Discord token into prod.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrastructureTerraform, Azure, CI/CD, operations

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions