rajyan/Preview Pages

Action to deploy a preview GitHub Pages for each branch, pull request, commit.

View on GitHub

Trust Signals

Scorecard Score
Scorecard 4–6scored Jul 6, 2026
Maintenance Recency
Maintainedlast commit Oct 20, 2025
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: rajyan/preview-pages@4fdab7d665d506f4dd2092bc9897ef707888071a # v1.3.37

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
source-dirPath of the directory you want to deploy. This is the only required input. yes
tokenThe 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-repositoryThe 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-branchThe branch you want to deploy GitHub Pages to.gh-pages
target-dirThe directory you want to deploy in the GitHub Pages repository. Defaults the root directory. .
configured-dirThe directory configured in GitHub Pages repository as a source. (ex. docs).
configured-domainThe custom domain configured in GitHub Pages repository.
git-config-nameUsername 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-emailEmail 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
cleanWhether to delete files in the destination that doesn't exist in source. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices.
clean-excludeFiles or paths to exclude from clean. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices.
forceForce-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
tagAdd a tag on commit. See https://github.com/JamesIves/github-pages-deploy-action#optional-choices.
pr-per-commitWhether 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-commentWhether 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-commitWhether 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-commentWhether to comment the preview page url on the branches commit. Valid options are 'each' or 'none'. each
namedescription
pages-urlThe deployed GitHub Pages url
upload-dirThe deployed directory under {{inputs.target-dir}}