Skip to content
Latchkey

JamesIves/github-pages-deploy-action: Deploy to Pages

github-pages-deploy-action deploys a built folder to a GitHub Pages branch.

An alternative to peaceiris/actions-gh-pages: point it at your build output and a target branch and it commits the deploy for you.

Key inputs (with:)

  • folder: the built directory to deploy (required).
  • branch: target branch (default gh-pages).
  • token: token for the push (GITHUB_TOKEN works).
  • clean: remove files not in the deploy folder.
  • target-folder: subdirectory within the branch.

Example workflow

.github/workflows/ci.yml
jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build
      - uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: dist
          branch: gh-pages

On any runner

This action runs on any runner. Latchkey managed runners run it unchanged.

Key takeaways

  • folder is your build output, not the source tree.
  • Needs contents: write to push the deploy.
  • A common alternative to peaceiris/actions-gh-pages.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card