|
1 | | -name: Deploy Docusaurus to GitHub Pages |
| 1 | +name: Deploy to GitHub Pages |
| 2 | + |
| 3 | +defaults: |
| 4 | + run: |
| 5 | + shell: bash |
| 6 | + working-directory: ./website |
2 | 7 |
|
3 | 8 | on: |
4 | 9 | push: |
5 | 10 | branches: |
6 | | - - main # Change to your default branch |
| 11 | + - main |
| 12 | + # Review gh actions docs if you want to further define triggers, paths, etc |
| 13 | + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on |
| 14 | + |
| 15 | + workflow_dispatch: |
| 16 | + |
| 17 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + pages: write |
| 21 | + id-token: write |
| 22 | + |
| 23 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 24 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 25 | +concurrency: |
| 26 | + group: "pages" |
| 27 | + cancel-in-progress: false |
7 | 28 |
|
8 | 29 | jobs: |
9 | | - deploy: |
| 30 | + build: |
| 31 | + name: Build Docusaurus |
10 | 32 | runs-on: ubuntu-latest |
11 | 33 | steps: |
12 | | - - name: Checkout repository |
13 | | - uses: actions/checkout@v3 |
14 | | - |
15 | | - - name: Set up Node.js |
16 | | - uses: actions/setup-node@v3 |
| 34 | + - uses: actions/checkout@v4 |
17 | 35 | with: |
18 | | - node-version: 20 # Use the Node.js version specified in your project |
| 36 | + fetch-depth: 0 |
| 37 | + - uses: actions/setup-node@v4 |
| 38 | + with: |
| 39 | + cache-dependency-path: ./website/package-lock.json |
| 40 | + node-version: 20 |
| 41 | + cache: npm |
19 | 42 |
|
20 | 43 | - name: Install dependencies |
21 | | - run: npm install |
22 | | - working-directory: ./website # Change to your subfolder |
23 | | - |
24 | | - - name: Build Docusaurus |
| 44 | + run: npm ci |
| 45 | + - name: Build website |
25 | 46 | run: npm run build |
26 | | - working-directory: ./website # Change to your subfolder |
27 | 47 |
|
28 | | - - name: Deploy to GitHub Pages |
29 | | - uses: peaceiris/actions-gh-pages@v3 |
| 48 | + - name: Upload Build Artifact |
| 49 | + uses: actions/upload-pages-artifact@v3 |
30 | 50 | with: |
31 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
32 | | - publish_dir: ./website/build # Path to the build folder |
| 51 | + path: ./website/build |
| 52 | + |
| 53 | + deploy: |
| 54 | + name: Deploy to GitHub Pages |
| 55 | + needs: build |
| 56 | + |
| 57 | + # Deploy to the github-pages environment |
| 58 | + environment: |
| 59 | + name: github-pages |
| 60 | + url: ${{ steps.deployment.outputs.page_url }} |
| 61 | + |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - name: Deploy to GitHub Pages |
| 65 | + id: deployment |
| 66 | + uses: actions/deploy-pages@v4 |
0 commit comments