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-pagesOn 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
peaceiris/actions-gh-pages: Deploy to GitHub PagesReference for peaceiris/actions-gh-pages: push a built static site to the gh-pages branch using GITHUB_TOKEN…
GitHub Actions Deprecations: What Is Breaking and How to Fix ItA running list of GitHub Actions deprecations - Node runtime versions, workflow commands, and runner images -…
dorny/paths-filter: Conditional Jobs by Changed PathsReference for dorny/paths-filter: detect which paths changed in a push or PR and gate downstream jobs or step…