Derick Montague | 1bddf79 | 2020-10-23 08:20:06 -0500 | [diff] [blame] | 1 | name: Deploy documentation to GitHub pages |
| 2 | on: |
Patrick Williams | 7385e13 | 2022-12-08 06:13:13 -0600 | [diff] [blame^] | 3 | push: |
| 4 | branches: [master] |
Derick Montague | 1bddf79 | 2020-10-23 08:20:06 -0500 | [diff] [blame] | 5 | jobs: |
Patrick Williams | 7385e13 | 2022-12-08 06:13:13 -0600 | [diff] [blame^] | 6 | build: |
| 7 | runs-on: ubuntu-latest |
Derick Montague | 1bddf79 | 2020-10-23 08:20:06 -0500 | [diff] [blame] | 8 | |
Patrick Williams | 7385e13 | 2022-12-08 06:13:13 -0600 | [diff] [blame^] | 9 | steps: |
| 10 | - uses: actions/checkout@v2 |
Derick Montague | 1bddf79 | 2020-10-23 08:20:06 -0500 | [diff] [blame] | 11 | |
Patrick Williams | 7385e13 | 2022-12-08 06:13:13 -0600 | [diff] [blame^] | 12 | - name: Generate static vuepress files |
| 13 | uses: actions/setup-node@v1 |
| 14 | with: |
| 15 | node-version: "12.x" |
| 16 | - run: npm ci |
| 17 | - run: npm run docs:build |
Derick Montague | 1bddf79 | 2020-10-23 08:20:06 -0500 | [diff] [blame] | 18 | |
Patrick Williams | 7385e13 | 2022-12-08 06:13:13 -0600 | [diff] [blame^] | 19 | - name: Init new repo in dist folder and commit generated files |
| 20 | run: | |
| 21 | cd docs/.vuepress/dist |
| 22 | git init |
| 23 | git add -A |
| 24 | git config --local user.email "action@github.com" |
| 25 | git config --local user.name "GitHub Action" |
| 26 | git commit -m 'deploy' |
Derick Montague | 1bddf79 | 2020-10-23 08:20:06 -0500 | [diff] [blame] | 27 | |
Patrick Williams | 7385e13 | 2022-12-08 06:13:13 -0600 | [diff] [blame^] | 28 | - name: Force push to gh-pages branch |
| 29 | uses: ad-m/github-push-action@v0.5.0 |
| 30 | with: |
| 31 | github_token: ${{ secrets.GITHUB_TOKEN }} |
| 32 | branch: gh-pages |
| 33 | force: true |
| 34 | directory: ./docs/.vuepress/dist |