rajyan/Preview Pages
Action to deploy a preview GitHub Pages for each branch, pull request, commit.
View on GitHubTrust Signals
- Scorecard Score
- Scorecard 4–6scored Jul 6, 2026
- Maintenance Recency
- Maintainedlast commit Oct 20, 2025
- License
- MIT
Pinned Snippet
uses: rajyan/preview-pages@4fdab7d665d506f4dd2092bc9897ef707888071a # v1.3.37tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| source-dir | Path of the directory you want to deploy. This is the only required input. | yes | — |
| token | The GitHub App token or personal access token to access GitHub Pages publishing repository and commenting to the pull requests and branches. Defaults to the repository scoped GitHub token (Which means that the repository you want to deploy GitHub Pages is the same one as you are running your workflow). | — | ${{ github.token }} |
| target-repository | The repository you want to deploy GitHub Pages to, in the format of 'rajyan/preview-pages'. Defaults to the current repository you are running the workflow. | — | ${{ github.repository }} |
| target-branch | The branch you want to deploy GitHub Pages to. | — | gh-pages |
| target-dir | The directory you want to deploy in the GitHub Pages repository. Defaults the root directory. | — | . |
| configured-dir | The directory configured in GitHub Pages repository as a source. (ex. docs) | — | . |
| configured-domain | The custom domain configured in GitHub Pages repository. | — | — |
| git-config-name | Username of the commit when deploying to the GitHub Pages publishing repository. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices | — | github-actions[bot] |
| git-config-email | Email of the commit when deploying to the GitHub Pages publishing repository. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices. | — | 41898282+github-actions[bot]@users.noreply.github.com |
| clean | Whether to delete files in the destination that doesn't exist in source. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices. | — | — |
| clean-exclude | Files or paths to exclude from clean. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices. | — | — |
| force | Force-push on deployment. Default is false which is different from the original action. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices. | — | false |
| tag | Add a tag on commit. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices. | — | — |
| pr-per-commit | Whether to keep different pages per each commit SHA or overwrite per each pull request. If 'true' the deploy directory for pull request will be '{{ inputs.target-dir }}/pr-{{ github.event.number }}/{{ github.sha }}'. If 'false' the directory will be '{{ inputs.target-dir }}/pr-{{ github.event.number }}' and overwrites on each commit. | — | true |
| pr-comment | Whether to comment the preview page url in a pull request and how. Valid choices are 'each' which posts a comment on each commit, 'append', 'sticky', 'recreate', 'hide_and_recreate' see https://github.com/marocchino/sticky-pull-request-comment for the options, or 'none' if you don't need the comment. | — | each |
| branch-per-commit | Whether to keep different pages per each commit SHA or overwrite per each branch. If 'true' the deploy directory for pull request will be '{{ inputs.target-dir }}/{{ github.ref_name }}/{{ github.sha }}'. If 'false' the directory will be '{{ inputs.target-dir }}/{{ github.ref_name }}' and overwrites on each commit. | — | true |
| branch-comment | Whether to comment the preview page url on the branches commit. Valid options are 'each' or 'none'. | — | each |
Outputs
| name | description |
|---|---|
| pages-url | The deployed GitHub Pages url |
| upload-dir | The deployed directory under {{inputs.target-dir}} |