This document covers:
- deploying locally to a single dev/sandbox organization
- deploying locally to all organizations in a stage
- how CircleCI publishes release artifacts and deploys them
- Use the repo Node version:
nvm use- Install dependencies using existing Git read access to the private
RoundingWell/pkg-iconsrepository:
npm ciCI uses node scripts/install-icons-ci.mjs with its configured GitHub App.
Local SSH-only setups use the checkout-local rewrite in installation prerequisites.
- Build
dist:
npm run build- Ensure AWS credentials are available.
For local runs, scripts use AWS SSO credentials (
AWS_PROFILE, default profile if unset). In CircleCI, AWS auth is provided via OIDC role assumption; long-lived access keys are not required.
Use the existing repo .env file and set deploy defaults:
DEPLOY_AWS_PROFILE=dev
DEPLOY_STAGE=dev
DEPLOY_ORGANIZATION=paulRun deploy with local defaults:
npm run deploy:devDeploy QA organizations directly (no stage/organization args needed):
npm run deploy:qa
npm run deploy:qa2Notes:
- CLI args still work and override stage/organization values:
npm run deploy:dev -- --stage=qa --organization=qa2
- If
AWS_PROFILEis already set in your shell, it takes precedence overDEPLOY_AWS_PROFILE. - QA app organization identifiers:
careops-qa-quality-assurance(npm run deploy:qa)careops-qa-qa2(npm run deploy:qa2)
AWS profile names are defined in:
~/.aws/config~/.aws/credentials
List profile section names:
grep -E '^\[.*\]$' ~/.aws/config ~/.aws/credentialsTypical names look like:
defaultdevlocalstack
Deploy a single environment by passing both --stage and --organization.
AWS_PROFILE=<your-profile> npm run deploy -- --stage=dev --organization=<organization-id>Example:
AWS_PROFILE=default npm run deploy -- --stage=dev --organization=paulThis discovers the deploy target in CloudFormation by tags:
stage=<stage>organization=<organization-id>
And then:
- Generates
dist/appconfig.jsonfrom Secrets Manager secretcustomer/<stage>/<organization-id> - Uploads
dist/to the organization's WebsiteBucket - Resolves the stack's
CloudFrontDistributionresource and invalidates CloudFront
Deploy every organization in a stage by omitting --organization:
AWS_PROFILE=<your-profile> npm run deploy -- --stage=sandboxThis pages CloudFormation results, filters by the stage=<stage> tag, and deploys each matching environment.
Release artifact publishing runs only for version tags matching:
vYYMMDD.N
The release-artifact workflow in
.circleci/workflows.yml:
- Builds
dist/ - Uploads sourcemaps to Datadog
- Packages
dist/as/tmp/dist.tar.gz - Publishes the artifact and checksum once per tag to:
- bucket:
rw-frontend-artifacts-dev - prefix:
app-frontend
- bucket:
CircleCI assumes AWS roles via OIDC before AWS-backed steps:
- dev account:
arn:aws:iam::104566035342:role/CircleCIRole - prod account:
arn:aws:iam::543732963292:role/CircleCIRole
Deploys run from the published release artifact, not directly from the tag build.
The deploy pipeline in .circleci/deploy.yml:
- Requires:
pipeline.deploy.environment_namepipeline.deploy.target_version
- Downloads the tagged artifact from
rw-frontend-artifacts-dev/app-frontend/<tag>/dist.tar.gz - Unpacks the artifact into
dist/ - Runs:
npm run deploy -- --stage=<stage> [--organization=<organization>]- Writes CircleCI deploy markers for every environment resolved from the deploy target:
- specific targets such as
qa:qa2write one marker for that concrete environment - stage-wide targets such as
qa:*,sandbox:*, andprod:*retain the wildcard marker and also write one marker per concrete environment discovered from CloudFormation tags for that stage sandbox:*also deploysprod:demonstrationfrom the same artifact and writes a marker for that environmentprod:*excludesprod:demonstration; deploy it explicitly or throughsandbox:*- stage-wide deploys continue through every resolved environment and fail the job at the end if any targets fail
- if a stage-wide deploy partially succeeds, concrete environment markers reflect the per-environment outcomes while the wildcard marker reflects the overall deploy result
- specific targets such as
- For QA deploys that include
qa2(qa:qa2andqa:*), postsqa2_deploy_succeededtoRoundingWell/app-tests - Updates the Linear release stage by running the pinned
linear/linear-releaseCLI (downloaded byscripts/download-linear-release.sh):qa:*and specificqa:<organization>deploys →update --stage=QAsandbox:*and specificsandbox:<organization>deploys →update --stage=Sandboxprod:*(wildcard only) →update --stage=Released, thencomplete- org-scoped
prod:<organization>deploys (e.g.prod:demonstration,prod:apple) are skipped — only the wildcard prod deploy represents a release event devdeploys are skipped- the step is failure-tolerant (
|| echo …); a Linear API or download failure does not fail the deploy job
Supported deploy environments:
dev:<organization>dev:*qa:*sandbox:*prod:*- specific environments such as
dev:nick,qa:qa2,sandbox:banana,prod:apple
Dev-account deploys:
dev:<organization>ordev:*qa:*
Prod-account deploys:
sandbox:*plusprod:demonstrationprod:*excludingprod:demonstration
Artifact ownership:
- the release artifact is published to the dev-account bucket
- QA deploys read that bucket with the dev role
- sandbox and prod deploys read that same bucket with the prod role
Additional CircleCI secrets for the QA2 E2E dispatch step:
GH_APP_IDGH_APP_PRIVATE_KEYGH_APP_INSTALLATION_ID
CircleCI context for the Linear release steps:
linear-secretscontext, providingLINEAR_ACCESS_KEY(Linear release pipeline access key)- attached to the
release-artifactworkflow in.circleci/workflows.yml(sync +Startedstage on tag build), and to thedeploy-qaanddeploy-prodworkflows in.circleci/deploy.yml. Thedeploy-devworkflow does not have access to the Linear secret. - the Linear release pipeline is configured as scheduled; stages used: built-in
Started, customQA(frozen) andSandbox, and built-in terminalReleased. CI also callscompleteafter a successful prod deploy.
For QA deploys that include qa2, .circleci/deploy.yml resolves the release SHA, passes the release tag, SHA, and a CircleCI run URL to scripts/dispatch-qa2-e2e.js, and that script uses the GitHub App credentials above plus the app-tests installation id to mint a short-lived installation token before posting repository_dispatch with this payload:
{
"source_repo": "RoundingWell/app-frontend",
"source_ref": "refs/tags/<release-tag>",
"source_sha": "<release-commit-sha>",
"source_run_url": "<circleci-build-url>",
"organization": "qa2",
"stage": "qa"
}- Create and push a release tag:
npm run release- Wait for the tag pipeline to publish the release artifact.
- In CircleCI Deploy, start a deploy using:
environment_name=<stage>:<organization|*>target_version=<release-tag>
- The deploy pipeline downloads the artifact for that tag and deploys the target environment.
- For stage-wide
dev:*,qa:*,sandbox:*, andprod:*deploys, the pipeline also writes markers for each concrete environment it resolved for that stage so later environment-specific deploys stay visible in CircleCI Deploy.
The AWS account must expose the deploy target to run successfully:
- Secrets Manager must have a secret named
customer/<stage>/<organization> - CloudFormation stack must have
stageandorganizationtags - CloudFormation stack must have a
WebsiteBucketoutput - Non-dev CloudFormation stacks must include a
CloudFrontDistributionresource
-
No environments found for stage=<stage>- Check
--stageand--organizationvalues. - Confirm the CloudFormation tags include
stageandorganization.
- Check
-
AWS credentials not available- Local deploy: verify SSO login and
AWS_PROFILE. - CircleCI deploy: verify the job assumed the expected
CircleCIRoleviaaws-cli/setup.
- Local deploy: verify SSO login and
-
No CloudFront distribution found for <stack>, skipping invalidation- Dev deploys skip invalidation when the stack has no
CloudFrontDistributionresource. - Non-dev deploys fail when CloudFront lookup or invalidation fails.
- Dev deploys skip invalidation when the stack has no