Nx plugin to deploy your app to GitHub Pages.
- Deploy static sites to GitHub Pages
- Automatic deployment from build output
- Configurable target branch
- Integration with GitHub Actions
- GitHub repository with Pages enabled
GH_PAGES_ACCESS_TOKENenvironment variable set with a GitHub Personal Access Token- A build target configured in your project
npm install -D @nx-extend/github-pagesAdd the deploy target to your project.json:
{
"targets": {
"build": {
"executor": "@nx/web:webpack",
"options": {
"outputPath": "dist/apps/my-app"
}
},
"deploy": {
"executor": "@nx-extend/github-pages:deploy",
"options": {
"branch": "gh-pages"
}
}
}
}nx deploy my-appSet the following environment variable before deploying:
export GH_PAGES_ACCESS_TOKEN="your-github-token"| Name | Type | Default | Description |
|---|---|---|---|
branch |
string |
"gh-pages" |
The branch to deploy to (typically gh-pages) |
- The executor automatically reads the
outputPathfrom your build target configuration - Make sure your build target runs before deploying
- The GitHub token needs repository write permissions