Skip to content

feat(020): simplify nightly — single identity, mock Stripe, GH Action deploys infra#523

Merged
MikeWedderburn-Clarke merged 9 commits intomainfrom
copilot/create-acute-publishing-gh-actions
Apr 12, 2026
Merged

feat(020): simplify nightly — single identity, mock Stripe, GH Action deploys infra#523
MikeWedderburn-Clarke merged 9 commits intomainfrom
copilot/create-acute-publishing-gh-actions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Eliminates staging identity dependency and Stripe/Entra requirements from nightly builds. The GH Action now deploys all infrastructure via Bicep; manual Azure setup is reduced to identity + OIDC + role assignments (~5 min).

Workflow (nightly.yml)

  • Single AZURE_CLIENT_ID_NIGHTLY identity for all jobs (build-and-push + deploy)
  • All Azure jobs use environment: nightly → one OIDC FIC instead of two
  • New deploy job runs az deployment group create with Bicep before smoke tests
  • Removed workflow-level env.REGISTRY (incompatible with environment-scoped secrets)

Bicep

  • deployDbWakeRole param on database.bicep (default true) — skips subscription-scoped custom role creation when the deploying identity only has RG-scoped Owner
  • main.bicep passes through to database module; backward-compatible

Nightly parameters

  • Hardcoded mock Stripe keys (sk_test_nightly_mock_...) and zero-UUID Entra IDs — pass Zod validation, no real accounts needed
  • Removed ${...} env var references (unsupported by az CLI; only work with azd)
  • Added deployDbWakeRole: false

GitHub secrets (5 total)

AZURE_CLIENT_ID_NIGHTLY, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID, AZURE_CONTAINER_REGISTRY, DB_ADMIN_PASSWORD

Quickstart (quickstart.md)

Rewritten as a single copy-paste shell script covering: RG → identity → FIC → Owner on RG → AcrPush/AcrPull on shared ACR → print secret values.

Copilot AI and others added 8 commits April 9, 2026 05:58
- Define nightly GitHub Actions workflow spec separate from existing CI/deploy
- Scheduled cron trigger (midnight UTC) with manual workflow_dispatch support
- Full CI validation suite gating: tokens → typecheck → lint → build → tests → bundle size → E2E → i18n → Storybook
- Docker image build, ACR push with nightly-specific tagging (date + commit)
- Dedicated nightly Azure Container App environment isolated from staging/production
- OIDC managed identity authentication pattern (Constitution XIV)
- Smoke tests against deployed nightly environment
- Concurrency controls, failure notifications, image traceability
- Specification quality checklist: all 16 items passing

Co-authored-by: MikeWedderburn-Clarke <5323631+MikeWedderburn-Clarke@users.noreply.github.com>
Co-authored-by: MikeWedderburn-Clarke <5323631+MikeWedderburn-Clarke@users.noreply.github.com>
Phase 0: Research (research.md) — 9 decisions covering cron scheduling,
concurrency controls, trigger strategy, image tagging, workflow job
structure, OIDC authentication architecture, Bicep infrastructure,
smoke test strategy, and environment parameterisation.

Phase 1: Design artifacts:
- data-model.md: Infrastructure entities (resource group, managed
  identity, container app, database, key vault, storage, monitoring)
  and CI/CD configuration entities (GitHub environment, image tags,
  workflow definition)
- contracts/nightly-workflow.yml: Full YAML contract for the 3-job
  workflow (validate → build-and-push → deploy-nightly)
- contracts/infrastructure.md: Bicep parameter changes to make Front
  Door and Container Registry modules conditional
- quickstart.md: Step-by-step setup guide for provisioning nightly
  infrastructure, configuring GitHub environment, and verification

Agent context updated for GitHub Copilot.

Co-authored-by: MikeWedderburn-Clarke <5323631+MikeWedderburn-Clarke@users.noreply.github.com>
…, and nightly parameters

Agent-Logs-Url: https://github.com/microsoft/CommunityManagement-Sample-Spec-Kit/sessions/4340bc9a-676f-42ad-9871-e8f81d815c2c

Co-authored-by: MikeWedderburn-Clarke <5323631+MikeWedderburn-Clarke@users.noreply.github.com>
…ightly-publish/

Agent-Logs-Url: https://github.com/microsoft/CommunityManagement-Sample-Spec-Kit/sessions/22fd65fe-319e-4b7c-9a31-a33ff81c99e7

Co-authored-by: MikeWedderburn-Clarke <5323631+MikeWedderburn-Clarke@users.noreply.github.com>
… deploys infra

- Use single nightly managed identity for all jobs (no staging identity dependency)
- All Azure jobs use `environment: nightly` with one OIDC FIC
- Deploy job runs full Bicep deployment (GH Action creates all infrastructure)
- Hardcode mock Stripe keys in nightly params (sk_test_nightly_mock_...)
- Hardcode mock Entra IDs (no real Entra app registration needed)
- Add deployDbWakeRole param to skip subscription-scoped custom role
- Rewrite quickstart.md with minimal copy-paste manual steps
- Reduce GitHub secrets from 5+Stripe to 5 total

Agent-Logs-Url: https://github.com/microsoft/CommunityManagement-Sample-Spec-Kit/sessions/ebe70735-7fea-44ed-ae3d-80cbd2c5e986

Co-authored-by: MikeWedderburn-Clarke <5323631+MikeWedderburn-Clarke@users.noreply.github.com>
@MikeWedderburn-Clarke
Copy link
Copy Markdown
Member

@copilot resolve conflicts and merge

…publishing-gh-actions

# Conflicts:
#	.github/agents/copilot-instructions.md

Co-authored-by: MikeWedderburn-Clarke <5323631+MikeWedderburn-Clarke@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 12, 2026

@copilot resolve conflicts and merge

Resolved the merge conflict in .github/agents/copilot-instructions.md (kept both recent changes entries and our newer date). Merge commit: e6ec0df. The branch is now up to date with main and ready to merge.

@MikeWedderburn-Clarke MikeWedderburn-Clarke marked this pull request as ready for review April 12, 2026 17:46
@MikeWedderburn-Clarke MikeWedderburn-Clarke merged commit 125aa02 into main Apr 12, 2026
6 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.

2 participants