|
1 | | -# REF: `https://jaimestill.github.io/docusaur-gh/deploy` |
| 1 | +# REF: `https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions` |
2 | 2 | name: Deploy Docusaurus to GitHub Pages |
3 | 3 |
|
4 | 4 | on: |
|
10 | 10 |
|
11 | 11 | defaults: |
12 | 12 | run: |
13 | | - working-directory: docs |
| 13 | + shell: bash |
| 14 | + working-directory: ./docs |
14 | 15 |
|
15 | 16 | jobs: |
16 | | - deploy: |
17 | | - name: Build Docusaurus to gh-pages |
| 17 | + build: |
| 18 | + name: Build Docusaurus |
18 | 19 | runs-on: ubuntu-latest |
19 | 20 | steps: |
20 | | - - uses: actions/checkout@v3 |
21 | | - - uses: actions/setup-node@v3 |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + - uses: actions/setup-node@v4 |
22 | 25 | with: |
23 | | - node-version: 22 |
| 26 | + node-version: 18 |
24 | 27 | cache: npm |
25 | | - cache-dependency-path: docs/package-lock.json |
26 | 28 |
|
27 | | - - name: Install dependencies |
| 29 | + - name: Install Dependencies |
28 | 30 | run: npm ci |
29 | | - - name: Build website |
| 31 | + - name: Build Website |
30 | 32 | run: npm run build |
31 | 33 |
|
32 | | - - name: Deploy to GitHub Pages |
33 | | - uses: peaceiris/actions-gh-pages@v3 |
| 34 | + - name: Upload Build Artifact |
| 35 | + uses: actions/upload-pages-artifact@v3 |
34 | 36 | with: |
35 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
36 | | - publish_dir: docs/build |
37 | | - user_name: github-actions[bot] |
38 | | - user_email: 41898282+github-actions[bot]@users.noreply.github.com |
| 37 | + path: build |
| 38 | + |
| 39 | + deploy: |
| 40 | + name: Deploy to GitHub Pages |
| 41 | + needs: build |
| 42 | + |
| 43 | + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment |
| 44 | + permissions: |
| 45 | + pages: write # to deploy to Pages |
| 46 | + id-token: write # to verify the deployment originates from an appropriate source |
| 47 | + |
| 48 | + # Deploy to the github-pages environment |
| 49 | + environment: |
| 50 | + name: github-pages |
| 51 | + url: ${{ steps.deployment.outputs.page_url }} |
| 52 | + |
| 53 | + runs-on: ubuntu-latest |
| 54 | + steps: |
| 55 | + - name: Deploy to GitHub Pages |
| 56 | + id: deployment |
| 57 | + uses: actions/deploy-pages@v4 |
0 commit comments