|
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 |
7 | 14 |
|
8 | 15 | jobs: |
9 | | - deploy: |
| 16 | + build: |
| 17 | + name: Build Docusaurus |
10 | 18 | runs-on: ubuntu-latest |
11 | 19 | steps: |
12 | | - - name: Checkout repository |
13 | | - uses: actions/checkout@v3 |
14 | | - |
15 | | - - name: Set up Node.js |
16 | | - uses: actions/setup-node@v3 |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + - uses: actions/setup-node@v4 |
17 | 24 | with: |
18 | | - node-version: 20 # Use the Node.js version specified in your project |
| 25 | + node-version: 20 |
| 26 | + cache: npm |
19 | 27 |
|
20 | 28 | - name: Install dependencies |
21 | | - run: npm install |
22 | | - working-directory: ./website # Change to your subfolder |
23 | | - |
24 | | - - name: Build Docusaurus |
| 29 | + run: npm ci |
| 30 | + - name: Build website |
25 | 31 | run: npm run build |
26 | | - working-directory: ./website # Change to your subfolder |
27 | 32 |
|
28 | | - - name: Deploy to GitHub Pages |
29 | | - uses: peaceiris/actions-gh-pages@v3 |
| 33 | + - name: Upload Build Artifact |
| 34 | + uses: actions/upload-pages-artifact@v3 |
30 | 35 | with: |
31 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
32 | | - publish_dir: ./website/build # Path to the build folder |
| 36 | + path: build |
| 37 | + |
| 38 | + deploy: |
| 39 | + name: Deploy to GitHub Pages |
| 40 | + needs: build |
| 41 | + |
| 42 | + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment |
| 43 | + permissions: |
| 44 | + pages: write # to deploy to Pages |
| 45 | + id-token: write # to verify the deployment originates from an appropriate source |
| 46 | + |
| 47 | + # Deploy to the github-pages environment |
| 48 | + environment: |
| 49 | + name: github-pages |
| 50 | + url: ${{ steps.deployment.outputs.page_url }} |
| 51 | + |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Deploy to GitHub Pages |
| 55 | + id: deployment |
| 56 | + uses: actions/deploy-pages@v4 |
0 commit comments