Anything you do to GitHub Actions twice should be automated. This walks the path from a manual install to a repeatable, pipeline-driven setup.
1. Install it reproducibly
mkdir -p .github/workflows
$EDITOR .github/workflows/ci.yml # workflows are just YAML files in the repo2. Describe the desired state
A CI workflow with caching and a matrix build.
name: ci
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix: { node: [18, 20, 22] }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: ${{ matrix.node }}, cache: npm }
- run: npm ci
- run: npm test3. Run it from CI
Deploy to AWS using OIDC - no long-lived secrets.
permissions: { id-token: write, contents: read }
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::1234:role/gha-deploy
aws-region: eu-west-1
- run: aws s3 sync ./dist s3://acme-site --deleteWant senior help putting GitHub Actions to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.