GitHub Actions Workflow Generator

Next

A fresh GitHub repository with no CI is one git push away from the next broken deploy. This generator writes a starter .github/workflows/ci.yml for Node, PHP or Laravel, wiring up checkout, the right runtime action, dependency install and the standard test command, everything you need to turn the green/red dot on.

How to generate a workflow

  1. 1

    Pick the stack

    Node (uses `actions/setup-node`), PHP (uses `shivammathur/setup-php`) or Laravel (PHP + `php artisan test`).

  2. 2

    Set the main branch

    `main` is the default; override if your repo still uses `master` or a custom name.

  3. 3

    Generate

    The tool assembles a YAML file with `push` and `pull_request` triggers on that branch.

  4. 4

    Commit to .github/workflows/

    Create the file at `.github/workflows/ci.yml` and push: the Actions tab lights up on the next commit.

What the workflow looks like

name: CI
on:
  push:
    branches: [main]
  pull_request:
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: '8.4'
      - run: composer install --no-interaction
      - run: php artisan test

Actions pinned by the generator

Action Purpose
actions/checkout@v4 Clone the repo into the runner
actions/setup-node@v4 Install a Node toolchain
shivammathur/setup-php@v2 Install a PHP version with extensions

What to add next

  • Lint step (npm run lint, ./vendor/bin/phpstan analyse) before the test step.
  • Matrix build: run across multiple Node/PHP versions with strategy.matrix.
  • Coverage upload: codecov-action or coveralls-action after the test step.
  • Secrets: never hardcode tokens, use secrets.XXX and define them under Settings → Actions.

Common pitfalls

  • Forgetting to fetch tags: with: { fetch-depth: 0 } on checkout when your release logic reads tags.
  • Using latest Docker images: pin versions to keep runs reproducible months later.
  • Running a 30-minute test suite on every push: split long jobs with needs: to parallelise.

Frequently Asked Questions

At .github/workflows/ci.yml in your repo root. GitHub picks up any YAML under that directory and shows each as a separate workflow in the Actions tab.

Pull requests from forks run the workflow but with GITHUB_TOKEN set to read-only. External contributors cannot access your secrets unless you explicitly opt in.

Add a strategy.matrix.php: [8.2, 8.3, 8.4] block and reference ${{ matrix.php }} in the setup-php step. The runner will spawn one job per version in parallel.

No. The generated YAML is shown on the page, is not uploaded or saved anywhere, and you copy it out yourself.

Related Tools

Tool available in other languages