peaceiris/actions-gh-pages@v4
GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.
At a glance
- Latest major
v4- Repository
- peaceiris/actions-gh-pages
- Inputs
- 20 (0 required)
- Outputs
- 0
- Runs using
node24- License
- MIT
- Last checked
Inputs and outputs come straight from the action's official action.yml. See our editorial standards.
Usage
- uses: peaceiris/actions-gh-pages@v4Inputs
| Name | Required | Default | Description |
|---|---|---|---|
deploy_key | No | none | Set a SSH private key from repository secret value for pushing to the remote branch. |
github_token | No | none | Set a generated GITHUB_TOKEN for pushing to the remote branch. |
personal_token | No | none | Set a personal access token for pushing to the remote branch. |
publish_branch | No | gh-pages | Set a target branch for deployment. |
publish_dir | No | public | Set an input directory for deployment. |
destination_dir | No | none | Set an destination subdirectory for deployment. |
external_repository | No | none | Set an external repository (owner/repo). |
allow_empty_commit | No | false | If empty commits should be made to the publication branch |
keep_files | No | false | If existing files in the publish branch should be not removed before deploying |
force_orphan | No | false | Keep only the latest commit on a GitHub Pages branch |
user_name | No | none | Set Git user.name |
user_email | No | none | Set Git user.email |
commit_message | No | none | Set a custom commit message with a triggered commit hash |
full_commit_message | No | none | Set a custom full commit message without a triggered commit hash |
tag_name | No | none | Set tag name |
tag_message | No | none | Set tag message |
enable_jekyll | No | false | Enable the GitHub Pages built-in Jekyll |
disable_nojekyll | No | false | An alias for enable_jekyll to disable adding .nojekyll file to a publishing branch |
cname | No | none | Set custom domain |
exclude_assets | No | .github | Set files or directories to exclude from a publish directory. |
Outputs
This action declares no outputs in its action.yml.
Examples
Publish a folder to GitHub Pages
Push built files to the gh-pages branch with the built-in token.
name: Example
on:
push:
branches: [main]
permissions:
contents: write
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build
run: mkdir -p dist && echo hi > dist/index.html
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./distEach example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.
Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.