Builds and pushes your GH pages deployment.
npm install git-deploy-gh-pagesYet another script to deploy to gh-pages. Also deploys PRs to subdirectory.
- Validates config
- Detects current remote
- Detects PR environment (in GitHub Actions)
- Builds app
- Clones current gh-pages branch
- Removes all files
- Copies new files to gh-pages
- Uses pr/number subdirectory for PRs.
- If any changes
- Commit
- Push
Requires a .gh-pages containing valid json specifying buildCommand. Other defaults that can be overridden are:
```
{
commitMessage: 'Deploy #PR to GitHub Pages.',
branch: 'gh-pages',
stagingDirectory: 'gh-pages-staging',
};
#PR will be replaced with "PR #X" if in the PR environment.
Runs git config if both GH_USER_NAME and GH_USER_EMAIL` env variables are set.