GitHub Actions CI/CD
DevOps / CI-CD GitHub Actions, OIDC
Delivery Constraint & Opportunity Analysis · Updated 1 month, 3 weeks ago
Content
Skill: GitHub Actions CI/CD
Capability Domain: DevOps / CI-CD
Technology Stack: GitHub Actions, OIDC
Linked Activities: Deploy via GitHub Actions
Skip when
Lake Scope Contract ci is not github_actions.
Recipe
- Workflows already live in the starter kit:
.github/workflows/deploy.ymlon push tomain(andworkflow_dispatch).permissions: { id-token: write, contents: read }. Do not invent a second pipeline in the clone. - Assume AWS role via
aws-actions/configure-aws-credentialswith OIDC. NoAWS_ACCESS_KEY_IDsecret. - Steps: pytest (
pandasin rootrequirements.txtif Streamlit unit tests import it) →cdk deploy --all --require-approval never. Print stack outputs to$GITHUB_STEP_SUMMARY. IAMsimulate-principal-policysmoke test that the Streamlit task role cans3:ListBucket/s3:GetObjecton the curated bucket. - OIDC trust — both
subshapes. GitHub Actions ID tokens often emitrepo:{org}@{ORG_ID}/{repo}@{REPO_ID}:ref:refs/heads/main, not onlyrepo:{org}/{repo}:*.DeployStackmust allow both. Template: starterinfra/ops_lake/deploy_stack.py. - Chicken-and-egg: laptop
cdk bootstrapthen one sandboxcdk deploy OpsLakeDeploy(or--all) to mintDeployRoleArn. Put that ARN in repo secretAWS_DEPLOY_ROLE_ARN. Thereafter shared env is GHA only. - A second workflow
populate-lake.yml(STEP 2) fills data — do not confuse it with deploy. Secret for GitHub API:OPSLAKE_GITHUB_PAT(scopesrepo,read:org). Never name a repo secretGITHUB_*— GitHub rejects that prefix. Template: starter.github/workflows/populate-lake.yml.
Copy-this: IAM trust conditions (DeployStack)
Trust token.actions.githubusercontent.com with:
- sub like repo:{org}/{lake_repo}:* and
- sub like repo:{org}@*/{lake_repo}@*:*
- aud = sts.amazonaws.com
Pitfalls
- Trusting only
repo:org/repo:*— AssumeRoleWithWebIdentity fails on ID-qualifiedsub. - Naming secrets
GITHUB_TOKEN/GITHUB_PAT. - Triggering deploy on every branch.
- Standing up GitLab CI in the same account.
- Laptop
cdk deployto the shared account after OIDC exists.
Details
- Capability Domain:
- DevOps / CI-CD
- Technology Stack:
- GitHub Actions, OIDC
- Created:
- 2 months ago
- Updated:
- 1 month, 3 weeks ago
Playbook
Activities Using This Skill 1
- Deploy via GitHub Actions Model and Deploy Infrastructure as Code