Skip to content

Choreography: Frontend Deployment Pipeline

OrderRunDirectoryTriggerRepos
1Run 1: Infrastructurerun-1-infrastructure/Manualinfrastructure, arda-frontend-app
2Run 2: Workflowsrun-2-workflows/After Run 1 exit gate passesarda-frontend-app
3Run 3: Validationrun-3-validation/After Run 2 exit gate passesarda-frontend-app
4Run 4: Cutoverrun-4-cutover/After Run 3 GO/NO-GO decisioninfrastructure, arda-frontend-app, documentation
ArtifactProduced ByConsumed ByPath/LocationFormat
demo branchRun 1Run 2arda-frontend-app repo, branch demoGit branch
amplifyBranch.cfn.yaml (modified)Run 1Run 1 (deploy), Run 4 (reference)infrastructure/src/main/cfn/amplifyBranch.cfn.yamlCloudFormation YAML
amplifyExports.cfn.yamlRun 1Run 4 (deploy for dev/stage/prod)infrastructure/src/main/cfn/amplifyExports.cfn.yamlCloudFormation YAML
amm.sh (modified)Run 1Run 1 (deploy), Run 4 (deploy export stacks)infrastructure/amm.shBash
amm.yml (modified)Run 1Run 1 (deploy via GH Actions)infrastructure/.github/workflows/amm.ymlGHA YAML
gh-oidc-provider.ts (modified)Run 1Run 1 (CDK deploy)infrastructure/src/main/cdk/constructs/oam/gh-oidc-provider.tsTypeScript
Alpha001-demo CloudFormation stacksRun 1Run 2 (workflow reads exports)AWS CloudFormation (us-east-1)Stacks
IAM roles (both accounts)Run 1Run 2 (OIDC assumption)AWS IAMRoles
CloudFormation exports (demo)Run 1Run 2, Run 3 (workflow reads)Alpha001-demo-I-AmplifyAppId, Alpha001-demo-I-AmplifyBranchNameCFn exports
deploy.yamlRun 2Run 3, Run 4arda-frontend-app/.github/workflows/deploy.yamlGHA YAML
redeploy.yamlRun 2Run 3, Run 4arda-frontend-app/.github/workflows/redeploy.yamlGHA YAML
reusable_deployment.yamlRun 2Run 3, Run 4arda-frontend-app/.github/workflows/reusable_deployment.yamlGHA YAML
GitHub environmentsRun 2Run 3, Run 4arda-frontend-app GitHub settingsConfig
PR1 (merged)Run 1Run 1 (deploy), Run 2 (entry criterion)infrastructure repo, merged to mainGit PR
GO/NO-GO decisionRun 3Run 4 (gate)run-3-validation/go-no-go.mdMarkdown
PR2 (merged)Run 4Run 4 (partition migration)arda-frontend-app repo, demo → mainGit PR
PR3 (merged)Run 4Ongoing operationsarda-frontend-app repo, trigger switchGit PR
Lightweight export stacks (dev/stage/prod)Run 4Run 4 (workflow reads)AWS CloudFormation (us-east-1)Stacks
rollback-plan.mdRun 4Run 4 (reference during cutover)Plan directoryMarkdown
post-cutover-instructions.mdRun 4Post-project (deferred)Plan directoryMarkdown
Frontend development guideRun 4Developers (ongoing)documentation/src/content/docs/process/craft/implementation/frontend-development.mdMarkdown

All changes reach main via PRs — no direct pushes to main in any repository. See specification.md — Pull Request Strategy for the full table.

PRRepoRunBranchContentGate
PR1infrastructureRun 1jmpicnic/frontend-pipeline/infrastructure-changesmainAll CFn templates, amm.sh, amm.yml, CDK role changesMerge before Kyle check + demo deployment
PR2arda-frontend-appRun 4demomainThree workflow files with full matrix + CI status check in redeployMerge before partition migration begins
PR3arda-frontend-appRun 4jmpicnic/frontend-pipeline/deploy-trigger-switchmaindeploy.yaml trigger switch: add workflow_run on CI successMerge after all partitions verified
PR4infrastructurePost-cutoverjmpicnic/frontend-pipeline/oidc-cleanupmainRemove refs/heads/demo from IAM role OIDC trustAfter pipeline is stable

All hand-offs are filesystem-only and AWS-state-only — no in-memory state is shared between runs. Each run reads its inputs from Git repositories, AWS CloudFormation exports, and files produced by prior runs.

  1. Run 1 completes and its validate-exit.sh passes.
  2. Operator verifies:
    • PR1 merged: infrastructure changes are on main
    • demo branch exists in arda-frontend-app
    • CloudFormation exports are available: Alpha001-demo-I-AmplifyAppId, Alpha001-demo-I-AmplifyBranchName
    • IAM role Alpha001-API-GitHubActionFrontEnd is assumable from arda-frontend-app
  3. Run 2 starts on the demo branch of arda-frontend-app.
  1. Run 2 completes and its validate-exit.sh passes.
  2. Operator verifies:
    • All three workflow files exist on the demo branch
    • deploy.yaml has been triggered at least once and succeeded
    • GitHub environments are configured
  3. Run 3 starts (no code changes — only workflow triggers and manual verification).
  4. No PRs in Runs 2–3: workflow development and validation happen entirely on the demo branch.
  1. Run 3 completes and its validate-exit.sh passes.
  2. GO/NO-GO decision: Operator reviews run-3-validation/go-no-go.md and explicitly confirms the decision to proceed with production cutover.
  3. All stakeholders (denisa, jmpicnic, danmerb, davequinta) are notified of the cutover plan.
  4. Run 4 begins with the rollback plan document.
  5. PR2 (demo → main) is created early in Run 4, before partition migration begins.
  6. PR3 (trigger switch) is created after all partitions are verified.
  • CloudFormation stack failure: Check aws cloudformation describe-stack-events for the failed stack. Fix the template and redeploy. CloudFormation rollback is automatic for failed creates.
  • CDK synth failure: Fix the TypeScript code and re-run npx cdk synth.
  • Kyle regression: If the Kyle deployment breaks, revert the infrastructure changes and redeploy Kyle via amm.sh SandboxKyle002 kyle.
  • Workflow YAML errors: Fix on the demo branch and re-push. No impact on existing pipeline.
  • OIDC assumption failure: Verify the IAM role trust policy matches the repository and branch. Check refs/heads/demo is in the OIDC subject conditions.
  • StartJob failure: Check the Amplify Console for error details. Common issues: wrong app ID, wrong branch name, missing environment variables.
  • Return to Run 2 to fix workflow issues, then re-run validation.
  • If the issue is infrastructure (wrong exports, role permissions), return to Run 1.
  • Per-partition rollback: Re-enable auto-build on the affected partition:
    Terminal window
    aws amplify update-branch --app-id {id} --branch-name {branch} --enable-auto-build --region {region}
  • Do not proceed to the next partition until the current one is verified.
  • If multiple partitions fail, consult the rollback plan and consider reverting to the pre-cutover state entirely.
RunCommandPRs
1Work in infrastructure repo; create and merge PR1; deploy via amm.sh or amm.yml workflowPR1
2Work on demo branch of arda-frontend-app; push workflows; configure environments via GitHub UI/CLINone
3Trigger workflows via GitHub Actions UI; manual site verificationNone
4Create and merge PR2 (demo → main); deploy export stacks; migrate partitions; create and merge PR3 (trigger switch)PR2, PR3