CI Admin Frontend Workflows - digitalspace/eagle-demi GitHub Wiki
Reference for the eagle-demi-admin workflows: PR checks and the test and production deploys. The
workflow index and repository settings are CI-Workflows.
Runs on every pull request against main in digitalspace/eagle-demi-admin. One job, contents: read only: corepack enable, yarn install --immutable, yarn lint, yarn test, then yarn build with VITE_BUILD_ID=pr (a PR build is never published, so the build id is a placeholder
rather than a sha). Node 24.
digitalspace/eagle-demi-admin's equivalent of the DEMI frontend deploy: pushes the Vite bundle to
$web on the demi-admin-cicd-test-managed storage account in c4b0a8-test-rg, behind the same
eagle-edge Front Door pattern. Triggers on push to main under src/**, public/**,
index.html, package.json, yarn.lock, vite.config.*, tsconfig*.json and
scripts/deploy-azure.sh, or workflow_dispatch.
- Rewrite
public/env.jsbefore the build, viascripts/point-env-js.sh test— the same script the production workflow calls, not inlinesed. It matches each line by key name rather than by its committed value, sets Keycloak host totest.loginproxy.gov.bc.ca,ENVIRONMENTto'test',APPINSIGHTS_CONNECTION_STRINGfromsecrets.APPINSIGHTS_CONNECTION_STRING_TEST(an environment secret on thetestGitHub environment, not a repository variable),ANALYTICS_API_URLfrom the repository variable of the same name, andconfigEndpoint(forcedtrue). Each rewrite is followed by agrepthat fails the job if it did not take — the script errors first ifAPPINSIGHTS_CONNECTION_STRINGis empty, before even callingpoint-env-js.sh. -
yarn testbeforeyarn build— a broken classifier stops the deploy instead of shipping and being found later on the Uptime screen. -
VITE_BUILD_IDset to the first 8 characters ofGITHUB_SHA, read at build time by Vite. -
./scripts/deploy-azure.sh(no target argument — this repo publishes only one bundle). - A Front Door smoke test (
GET /expects 200) that no-ops with a notice ifAZURE_FRONTDOOR_ENDPOINTis not yet set as a repository variable.
Identity: UAMI demi-admin-cicd-test, federated subject
repo:digitalspace/eagle-demi-admin:environment:test. Holds Storage Blob Data Contributor and
Storage Account Contributor on that one storage account, nothing wider.
workflow_dispatch only, taking a tag input shaped vX.Y.Z. The job checks out refs/tags/<tag>
before anything else runs, so a branch of the same name cannot slip in, and stamps the tag itself
into VITE_BUILD_ID — the build carries the release it came from, not a sha.
- Rewrite
public/env.jsat the checked-out tag withscripts/point-env-js.sh prod— the same script the test workflow calls. Sets Keycloak host tologinproxy.gov.bc.ca,ENVIRONMENTto'prod',APPINSIGHTS_CONNECTION_STRINGfromsecrets.APPINSIGHTS_CONNECTION_STRING_PROD,ANALYTICS_API_URLfrom the repository variable, andconfigEndpoint(forcedtrue). There is nonotify-api-prodyet, soNOTIFY_API_LOCATIONstays unset and the eagle-notify screen in production reads "Not configured". -
yarn testbeforeyarn build, same reasoning as test. -
./scripts/deploy-azure.sh, then the same Front Door smoke test as the test workflow.
Identity: UAMI demi-admin-cicd-prod in rg-demi-prod (subscription c4b0a8-prod), federated
subject repo:digitalspace/eagle-demi-admin:environment:prod. Holds Storage Blob Data Contributor
and Storage Account Contributor on the production storage account, granted by
azure/main.prod.bicepparam via uploaderPrincipalId — the two role assignments are skipped while
that value is empty, and the first publish then fails with 403.
Secrets on the prod GitHub environment: AZURE_CLIENT_ID, AZURE_TENANT_ID,
APPINSIGHTS_CONNECTION_STRING_PROD. Variables: AZURE_SUBSCRIPTION_ID,
AZURE_FRONTEND_STORAGE_ACCOUNT (demiadmproduvtikwlcqtpga), AZURE_FRONTDOOR_ENDPOINT
(demi-admin-prod-hfgebphjbucqd5bt.a01.azurefd.net), ANALYTICS_API_URL. The
AZURE_FRONTDOOR_ENDPOINT host comes from the sites[] entry this app gets added as in
digitalspace/eagle-edge (PR #27, param demiAdminFrontendWebHostName plus
demiApimDeployed = true, routes default and api).
The production estate is live: storage account demiadmproduvtikwlcqtpga in rg-demi-prod
(subscription be5924ac-1083-4a1b-be92-7b444882cfd9), Front Door endpoint above on profile
eagle-edge-prod. demi-api-fc-prod's CORS_ORIGIN holds that Front Door host (eagle-demi PR
#344, frontendHostNames), and Keycloak prod client eagle-admin-console has a redirect URI for
it, added with scripts/keycloak-add-redirect.sh (ENV=prod). First live tag v1.0.1.
deploy-infra.sh prod needs APIM_SHARED_HEADER_VALUE and AUDIT_SHARED_HEADER_VALUE exported by
hand before a rerun; both are readable from app settings on analytics-api-fc-prod
(rg-eagle-public-prod).