GitHub Actions workflow generator for CI and Docker builds

Choose a stack, the branches and the steps you need, and the tool writes a ready-to-commit GitHub Actions workflow file with read-only permissions, caching and cancel-on-new-push.

Live demo · real result from this tool
Stack
Package manager

.github/workflows/ci.yml

# Save as .github/workflows/ci.yml# Action versions checked against each action's latest release on 2026-10-02.name: CI on:  push:    branches: [main]  pull_request:    branches: [main] permissions:  contents: read concurrency:  group: ${{ github.workflow }}-${{ github.ref }}  cancel-in-progress: true jobs:  test:    runs-on: ubuntu-latest    strategy:
      fail-fast: false
      matrix:
        node: ["22", "24"]
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: ${{ matrix.node }}
          cache: npm
      - name: Install dependencies
        run: npm ci
      - name: Lint
        run: npm run lint
      - name: Test
        run: npm test
      - name: Build
        run: npm run build

Action major versions checked on 2026-10-02: actions/checkout@v7, actions/setup-node@v7. Pin to a commit SHA if your security policy requires it.

Processed on your device — nothing is uploaded.

How to use the GitHub Actions generator

  1. Pick the Stack: Node.js, Python, Go or Docker image.
  2. Set the Workflow name and Branches (comma-separated, for example main, develop).
  3. For Node.js, Python or Go, enter Versions to test, choose the Runner and tick Lint step, Test step and Build step. Node.js also has Package manager: npm, pnpm or Yarn.
  4. For Docker, decide on Push to GitHub Container Registry and an optional Image name.
  5. Choose Run on pull requests and Allow manual runs, then save the YAML under .github/workflows/.

What it does and when to use it

Continuous integration runs your checks on every push, so broken code is caught before it is merged. This tool gives you a working first workflow without reading the whole workflow syntax reference.

Use it for a new repository or to replace a workflow with outdated action versions. The Node.js steps need matching scripts, which the package.json generator writes. A Docker workflow builds the Dockerfile in your repository root, which you can create with the Dockerfile generator. For dependency updates, add the dependabot.yml generator output.

How it works

Every file has the same safe base: permissions: contents: read, and a concurrency group that cancels an older run when you push again to the same branch.

  • Node.js: checkout, optional pnpm/action-setup, actions/setup-node with dependency caching, then a clean install (npm ci, pnpm install --frozen-lockfile or yarn install --immutable) and your ticked steps.
  • Python: actions/setup-python with pip caching, pip install -r requirements.txt, then ruff check ., pytest and python -m build.
  • Go: go vet ./..., go build ./... and go test -race ./....
  • Docker image: Buildx, a GHCR login skipped on pull requests, docker/metadata-action for tags, and docker/build-push-action with the GitHub Actions cache.

Blank versions fall back to Node.js 24, Python 3.14 or Go 1.27. Action versions were checked on 2026-10-02.

Worked examples

Default Node.js workflow. Versions 22, 24 create a matrix:

    strategy:
      fail-fast: false
      matrix:
        node: ["22", "24"]

followed by npm ci, npm run lint, npm test and npm run build.

Python, one version, tests only. Stack Python, versions 3.13, Lint and Build unticked. There is no matrix; the setup step reads python-version: "3.13" with cache: pip, and the last step installs and runs pytest.

Docker image. Stack Docker with push on. The file adds packages: write and builds with push: ${{ github.event_name != 'pull_request' }}, so pull requests build the image without publishing it.

Limits and tips

  • One job per file. Deployments, release jobs and service containers are not generated.
  • Check the runner. Windows and macOS runners make sense for cross-platform tools; otherwise keep Ubuntu.
  • Add secrets in repository settings, never in the YAML itself.

Frequently asked questions

Where do I save the workflow file?
In .github/workflows/ in your repository, as ci.yml or docker.yml (the output names it). Push it and the run appears in the Actions tab.
Why does the workflow fail at the Lint or Build step?
For Node.js the steps call npm run lint and npm run build, so your package.json needs scripts with those names. Either add the scripts or untick the steps. For Python the install step expects a requirements.txt file.
Do I need to add a secret to push Docker images?
No. The login step uses the GITHUB_TOKEN that GitHub creates for every run, and the workflow grants it packages write permission. Images are pushed only on push events, never for pull requests.
What does the version matrix do?
With more than one version, such as 22, 24, the job runs once per version in parallel. fail-fast is false, so one failure does not cancel the rest.
Should I pin actions to a commit SHA?
The file uses major-version tags such as actions/checkout@v7, which receive fixes automatically. If your security policy asks for fixed versions, replace each tag with the full commit SHA of a release.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close