Basic Workflow Example

Create .github/workflows/deploy.yml:

name: Deploy

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '22'
      - run: npm install
      - run: npm run build

Common Triggers

on:
  push:
    branches: [main]
  workflow_dispatch:

Key Points

  • The .github/workflows/ folder name must be exact
  • YAML indentation matters โ€” use 2 spaces
  • Store secrets in Settings โ†’ Secrets