Skip to content
BEAD

GitHub Actions Starter

Workflow YAML for Node CI, Python pytest, Go, Rust, Docker build/push, or GitHub Pages deploy.

.github/workflows/ci.yml
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [20, 22]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          cache: npm
      - run: npm ci
      - run: npm run lint --if-present
      - run: npm test
      - run: npm run build --if-present

Action versions

Templates use the current major versions of common actions (checkout@v4, language setup actions @v4/ @v5, docker/build-push-action@v6). Always pin to a SHA in production for supply-chain safety.

Concurrency

The Pages workflow uses a concurrency group so a second push cancels the previous build mid-flight instead of queueing.

You might also like