--- title: "GitHub Actions" source: "https://docs.palt.io/github-actions" --- # GitHub Actions Publish your docs on every push: the spec when `openapi.yaml` changes, the guide pages when anything under `docs/` does. 1. Create an API key in **Settings → API keys**. 2. Add it to your repository as the secret `PALT_API_KEY` (Settings → Secrets and variables → Actions). 3. Add `.github/workflows/docs.yml`: ```yaml name: Docs on: push: branches: [main] paths: - openapi.yaml - docs/** concurrency: palt-docs jobs: docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - run: npx -y palt push openapi.yaml --project acme-api env: PALT_API_KEY: ${{ secrets.PALT_API_KEY }} - run: npx -y palt pages push docs --project acme-api env: PALT_API_KEY: ${{ secrets.PALT_API_KEY }} ``` A failed push fails the job and prints the reason, such as an invalid spec or an expired key.