|
16 | 16 | schedule:
|
17 | 17 | - cron: '42 16 1/7 * *'
|
18 | 18 |
|
| 19 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | + pages: write |
| 23 | + id-token: write |
| 24 | + |
| 25 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 26 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 27 | +concurrency: |
| 28 | + group: "pages" |
| 29 | + cancel-in-progress: false |
| 30 | + |
19 | 31 | env:
|
20 | 32 | MDBOOK_LINKCHECK_VER: 0.7.6
|
21 | 33 |
|
@@ -62,43 +74,21 @@ jobs:
|
62 | 74 | run: |
|
63 | 75 | mdbook build
|
64 | 76 |
|
65 |
| - - name: Store final build |
66 |
| - uses: actions/upload-artifact@v2 |
| 77 | + - name: Upload artifact |
| 78 | + uses: actions/upload-pages-artifact@v1 |
67 | 79 | with:
|
68 |
| - name: Build output |
69 | 80 | path: pandocs/docs/pandocs/
|
70 |
| - if-no-files-found: error |
71 | 81 |
|
72 | 82 | deploy:
|
73 | 83 | name: Deploy to GitHub pages
|
| 84 | + # Do not run this unless *pushing* to `master`. |
| 85 | + if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
| 86 | + environment: |
| 87 | + name: github-pages |
| 88 | + url: ${{ steps.deployment.outputs.page_url }} |
74 | 89 | runs-on: ubuntu-latest
|
75 | 90 | needs: build
|
76 |
| - # Do not run this unless *pushing* to `master` |
77 |
| - if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
78 | 91 | steps:
|
79 |
| - - name: Checkout pandocs/gh-pages |
80 |
| - uses: actions/checkout@v2 |
81 |
| - with: |
82 |
| - path: pandocs |
83 |
| - ref: gh-pages |
84 |
| - |
85 |
| - - name: Delete all current files |
86 |
| - run: | |
87 |
| - rm -vrf pandocs/* |
88 |
| -
|
89 |
| - - name: Unpack build |
90 |
| - uses: actions/download-artifact@v2 |
91 |
| - with: |
92 |
| - name: Build output |
93 |
| - path: pandocs/ |
94 |
| - |
95 |
| - - name: Deploy |
96 |
| - working-directory: pandocs/ |
97 |
| - run: | |
98 |
| - git config --local user.name "GitHub Action" |
99 |
| - git config --global user.email "[email protected]" |
100 |
| - git remote -v |
101 |
| - git branch -v |
102 |
| - git add -A |
103 |
| - git commit -am 'Update build' |
104 |
| - git push -v |
| 92 | + - name: Deploy to GitHub Pages |
| 93 | + id: deployment |
| 94 | + uses: actions/deploy-pages@v2 |
0 commit comments