|
1 | | -# Simple workflow for deploying static content to GitHub Pages |
2 | | -name: Deploy to GitHub Pages |
| 1 | +# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
| 2 | +name: Deploy Jekyll with GitHub Pages dependencies preinstalled |
3 | 3 |
|
4 | 4 | on: |
| 5 | + # Runs on pushes targeting the default branch |
5 | 6 | push: |
6 | | - branches: [ main ] |
| 7 | + branches: [$default-branch] |
7 | 8 |
|
| 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 |
8 | 13 | permissions: |
9 | | - contents: write |
| 14 | + contents: read |
10 | 15 | pages: write |
11 | 16 | id-token: write |
12 | | - pull-requests: write |
13 | | - repository-projects: write |
| 17 | + |
| 18 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 19 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 20 | +concurrency: |
| 21 | + group: "pages" |
| 22 | + cancel-in-progress: false |
14 | 23 |
|
15 | 24 | jobs: |
| 25 | + # Build job |
16 | 26 | build: |
17 | 27 | runs-on: ubuntu-latest |
18 | 28 | steps: |
19 | 29 | - name: Checkout |
20 | 30 | uses: actions/checkout@v4 |
21 | | - |
22 | | - - name: Setup pnpm |
23 | | - uses: pnpm/action-setup@v4 |
| 31 | + - name: Setup Pages |
| 32 | + uses: actions/configure-pages@v5 |
| 33 | + - name: Build with Jekyll |
| 34 | + uses: actions/jekyll-build-pages@v1 |
24 | 35 | with: |
25 | | - version: 9 |
26 | | - |
27 | | - - name: Install dependencies |
28 | | - run: pnpm install |
29 | | - |
30 | | - - name: Build application |
31 | | - run: pnpm build:docs |
32 | | - |
33 | | - - name: Save build folder |
34 | | - uses: actions/upload-artifact@v4 |
35 | | - with: |
36 | | - name: build |
37 | | - if-no-files-found: error |
38 | | - path: ./_site |
| 36 | + source: ./ |
| 37 | + destination: ./_site |
| 38 | + - name: Upload artifact |
| 39 | + uses: actions/upload-pages-artifact@v3 |
39 | 40 |
|
| 41 | + # Deployment job |
40 | 42 | deploy: |
41 | | - runs-on: ubuntu-latest |
42 | | - needs: build |
43 | 43 | environment: |
44 | 44 | name: github-pages |
45 | 45 | url: ${{ steps.deployment.outputs.page_url }} |
46 | | - strategy: |
47 | | - matrix: |
48 | | - node-version: [20] |
49 | | - |
| 46 | + runs-on: ubuntu-latest |
| 47 | + needs: build |
50 | 48 | steps: |
51 | | - - name: Setup pnpm |
52 | | - uses: pnpm/action-setup@v4 |
53 | | - with: |
54 | | - version: 9 |
55 | | - |
56 | | - - name: Checkout |
57 | | - uses: actions/checkout@v4 |
58 | | - |
59 | | - - name: Download the build folder |
60 | | - uses: actions/download-artifact@v4 |
61 | | - with: |
62 | | - name: build |
63 | | - path: ./_site |
64 | | - |
65 | | - - name: Install dependencies |
66 | | - run: pnpm install |
67 | | - |
68 | | - - name: Use Node.js ${{ matrix.node-version }} |
69 | | - uses: actions/setup-node@v3 |
70 | | - with: |
71 | | - node-version: ${{ matrix.node-version }} |
72 | | - |
73 | 49 | - name: Deploy to GitHub Pages |
74 | 50 | id: deployment |
75 | 51 | uses: actions/deploy-pages@v4 |
0 commit comments