|
1 | | -name: Deploy to GitHub Pages |
| 1 | +# Simple workflow for deploying static content to GitHub Pages |
| 2 | +name: Deploy static content to Pages |
2 | 3 |
|
3 | 4 | on: |
| 5 | + # Runs on pushes targeting the default branch |
4 | 6 | push: |
5 | | - branches: |
6 | | - - main # or your primary branch |
| 7 | + branches: ["main"] |
| 8 | + |
| 9 | + # Allows you to run this workflow manually from the Actions tab |
7 | 10 | workflow_dispatch: |
8 | 11 |
|
| 12 | +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + id-token: write |
| 17 | + |
| 18 | +# Allow one concurrent deployment |
| 19 | +concurrency: |
| 20 | + group: "pages" |
| 21 | + cancel-in-progress: true |
| 22 | + |
9 | 23 | jobs: |
10 | | - build-and-deploy: |
| 24 | + # Single deploy job since we're just deploying |
| 25 | + deploy: |
| 26 | + environment: |
| 27 | + name: github-pages |
| 28 | + url: ${{ steps.deployment.outputs.page_url }} |
11 | 29 | runs-on: ubuntu-latest |
12 | 30 | steps: |
13 | 31 | - name: Checkout |
14 | | - uses: actions/checkout@v4 |
15 | | - |
| 32 | + uses: actions/checkout@v5 |
16 | 33 | - name: Install pnpm |
17 | 34 | uses: pnpm/action-setup@v4 |
18 | 35 | with: |
19 | 36 | version: 9 |
20 | | - |
21 | | - - name: Setup Node.js |
22 | | - uses: actions/setup-node@v4 |
| 37 | + - name: Set up Node |
| 38 | + uses: actions/setup-node@v6 |
23 | 39 | with: |
24 | | - node-version: "20" # or your preferred Node.js version |
25 | | - |
| 40 | + node-version: "20" |
| 41 | + cache: "pnpm" |
26 | 42 | - name: Install dependencies |
27 | 43 | run: pnpm install |
28 | | - |
29 | 44 | - name: Build project |
30 | 45 | run: pnpm run build |
31 | | - |
32 | | - - name: Deploy to GitHub Pages |
33 | | - uses: peaceiris/actions-gh-pages@v4 |
| 46 | + - name: Setup Pages |
| 47 | + uses: actions/configure-pages@v5 |
| 48 | + - name: Upload artifact |
| 49 | + uses: actions/upload-pages-artifact@v4 |
34 | 50 | with: |
35 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
36 | | - publish_dir: ./dist # Assumes your build output is in 'dist' |
| 51 | + # Upload dist folder |
| 52 | + path: "./dist" |
| 53 | + - name: Deploy to GitHub Pages |
| 54 | + id: deployment |
| 55 | + uses: actions/deploy-pages@v4 |
0 commit comments