|
1 |
| -# Simple workflow for deploying static content to GitHub Pages |
2 |
| -name: Deploy static content to Pages |
| 1 | +name: Deploy to GitHub Pages |
3 | 2 |
|
4 | 3 | on:
|
5 |
| - # Runs on pushes targeting the default branch |
6 | 4 | push:
|
7 |
| - branches: [main] |
| 5 | + branches: |
| 6 | + - main |
| 7 | + # Review gh actions docs if you want to further define triggers, paths, etc |
| 8 | + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on |
8 | 9 |
|
9 |
| - # Allows you to run this workflow manually from the Actions tab |
10 |
| - workflow_dispatch: |
11 |
| - |
12 |
| -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
13 |
| -permissions: |
14 |
| - contents: read |
15 |
| - pages: write |
16 |
| - id-token: write |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + name: Build Docusaurus |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + fetch-depth: 0 |
| 18 | + - uses: actions/setup-node@v4 |
| 19 | + with: |
| 20 | + node-version: 18 |
| 21 | + cache: npm |
17 | 22 |
|
18 |
| -# Allow one concurrent deployment |
19 |
| -concurrency: |
20 |
| - group: "pages" |
21 |
| - cancel-in-progress: true |
| 23 | + - name: Install dependencies |
| 24 | + run: npm ci |
| 25 | + - name: Build website |
| 26 | + run: npm run build |
22 | 27 |
|
23 |
| -env: |
24 |
| - # Hosted GitHub runners have 7 GB of memory available, let's use 6 GB |
25 |
| - NODE_OPTIONS: --max-old-space-size=6144 |
| 28 | + - name: Upload Build Artifact |
| 29 | + uses: actions/upload-pages-artifact@v3 |
| 30 | + with: |
| 31 | + path: build |
26 | 32 |
|
27 |
| -jobs: |
28 |
| - # Single deploy job since we're just deploying |
29 | 33 | deploy:
|
| 34 | + name: Deploy to GitHub Pages |
| 35 | + needs: build |
| 36 | + |
| 37 | + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment |
| 38 | + permissions: |
| 39 | + pages: write # to deploy to Pages |
| 40 | + id-token: write # to verify the deployment originates from an appropriate source |
| 41 | + |
| 42 | + # Deploy to the github-pages environment |
30 | 43 | environment:
|
31 | 44 | name: github-pages
|
32 | 45 | url: ${{ steps.deployment.outputs.page_url }}
|
| 46 | + |
33 | 47 | runs-on: ubuntu-latest
|
34 | 48 | steps:
|
35 |
| - - name: Checkout |
36 |
| - uses: actions/checkout@v3 |
37 |
| - - name: Set up Node.js |
38 |
| - uses: actions/setup-node@v3 |
39 |
| - with: |
40 |
| - node-version: 16.x |
41 |
| - cache: yarn |
42 |
| - - name: Install dependencies |
43 |
| - run: yarn install --frozen-lockfile --non-interactive |
44 |
| - - name: Build |
45 |
| - run: yarn build |
46 |
| - - name: Setup Pages |
47 |
| - uses: actions/configure-pages@v3 |
48 |
| - - name: Upload artifact |
49 |
| - uses: actions/upload-pages-artifact@v2 |
50 |
| - with: |
51 |
| - # Upload entire repository |
52 |
| - path: build |
53 | 49 | - name: Deploy to GitHub Pages
|
54 | 50 | id: deployment
|
55 |
| - uses: actions/deploy-pages@v2 |
| 51 | + uses: actions/deploy-pages@v4 |
0 commit comments