|
1 | | -# deploy-github-pages |
2 | | -Deploy Grace Guides to GitHub Pages |
| 1 | +# Deploy Multi-Version Documentation to GitHub Pages 🚀 |
| 2 | + |
| 3 | +[](https://github.com/rainboyan/deploy-github-pages/releases/latest) |
| 4 | + |
| 5 | + |
| 6 | +This action is used to deploy multi-version documentation to [GitHub Pages](https://pages.github.com/). |
| 7 | + |
| 8 | +## Usage |
| 9 | + |
| 10 | +We recommend this action to be used in a dedicated job: |
| 11 | + |
| 12 | +```yaml |
| 13 | +jobs: |
| 14 | + # Build job |
| 15 | + build: |
| 16 | + permissions: |
| 17 | + contents: read # to fetch code (actions/checkout) |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: Deploy to GitHub Pages |
| 21 | + id: deployment |
| 22 | + uses: rainboyan/deploy-github-pages@v1 |
| 23 | + env: |
| 24 | + TOKEN: ${{ secrets.GH_TOKEN }} # GitHub Personal Access Token |
| 25 | + VERSION: '1.0.0-SNAPSHOT' # The version of the documentation |
| 26 | + BRANCH: gh-pages # The branch to deploy |
| 27 | + FOLDER: build/docs # The directory of the generated documentation |
| 28 | +``` |
| 29 | +
|
| 30 | +Here’s the directory structure for the documentation, |
| 31 | +
|
| 32 | +```bash |
| 33 | +. |
| 34 | +├── 1.0.0-SNAPSHOT |
| 35 | +│ ├── .. |
| 36 | +│ └── index.html |
| 37 | +├── 1.0.x |
| 38 | +│ ├── .. |
| 39 | +│ └── index.html |
| 40 | +├── latest |
| 41 | +│ ├── .. |
| 42 | +│ └── index.html |
| 43 | +├── snapshot |
| 44 | +│ ├── .. |
| 45 | +│ └── index.html |
| 46 | +└── README.md |
| 47 | +``` |
| 48 | + |
| 49 | +After deployment is successful, you can access the documentation through the following links, |
| 50 | + |
| 51 | +* https://OWNER.github.io/REPO/1.0.0-SNAPSHOT/ |
| 52 | +* https://OWNER.github.io/REPO/1.0.x/ |
| 53 | +* https://OWNER.github.io/REPO/latest/ |
| 54 | +* https://OWNER.github.io/REPO/snapshot/ |
| 55 | + |
| 56 | +### Environment Variables 🌎 |
| 57 | + |
| 58 | +| Variable | Description | |
| 59 | +| -------- | ----------- | |
| 60 | +| `TOKEN` | GitHub Personal Access Token | |
| 61 | +| `VERSION` | The version of the documentation, if empty it will deploy to the ROOT | |
| 62 | +| `BRANCH` | The branch to deploy | |
| 63 | +| `FOLDER` | The directory of the generated documentation | |
| 64 | +| `CNAME` | This will create a CNAME file | |
| 65 | + |
| 66 | +## License |
| 67 | + |
| 68 | +The scripts and documentation in this project are released under the [MIT License](LICENSE). |
| 69 | + |
| 70 | +## Links |
| 71 | + |
| 72 | +- [Grace Framework](https://github.com/graceframework/grace-framework) |
| 73 | +- [Grace Plugins](https://github.com/grace-plugins) |
0 commit comments