|
1 |
| -# Sample workflow for building and deploying a VitePress site to GitHub Pages |
2 |
| -# |
3 |
| -name: Deploy VitePress site to Pages |
| 1 | +name: Deploy to Github Pages |
4 | 2 |
|
5 | 3 | on:
|
6 |
| - # Runs on pushes targeting the `main` branch. Change this to `master` if you're |
7 |
| - # using the `master` branch as the default branch. |
8 | 4 | push:
|
9 | 5 | branches: [main]
|
10 | 6 |
|
11 |
| - # Allows you to run this workflow manually from the Actions tab |
| 7 | + # allows you to run this workflow manually from the Actions tab |
12 | 8 | workflow_dispatch:
|
13 | 9 |
|
14 |
| -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 10 | +# sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
15 | 11 | permissions:
|
16 | 12 | contents: read
|
17 | 13 | pages: write
|
18 | 14 | id-token: write
|
19 | 15 |
|
20 |
| -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
21 |
| -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
22 | 16 | concurrency:
|
23 | 17 | group: pages
|
24 | 18 | cancel-in-progress: false
|
25 | 19 |
|
26 | 20 | jobs:
|
27 |
| - # Build job |
28 | 21 | build:
|
29 | 22 | runs-on: ubuntu-latest
|
30 | 23 | steps:
|
31 | 24 | - name: Checkout
|
32 | 25 | uses: actions/checkout@v4
|
33 | 26 | with:
|
34 |
| - fetch-depth: 0 # Not needed if lastUpdated is not enabled |
| 27 | + fetch-depth: 0 # not needed if lastUpdated is not enabled |
35 | 28 | submodules: true
|
36 |
| - # - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm |
37 |
| - # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun |
| 29 | + |
| 30 | + - uses: pnpm/action-setup@v4 |
| 31 | + name: Install pnpm |
| 32 | + with: |
| 33 | + version: 10 |
| 34 | + run_install: false |
| 35 | + |
38 | 36 | - name: Setup Node
|
39 | 37 | uses: actions/setup-node@v4
|
40 | 38 | with:
|
41 |
| - node-version: 18 |
42 |
| - cache: npm # or pnpm / yarn |
| 39 | + node-version: 20 |
| 40 | + cache: pnpm |
| 41 | + |
43 | 42 | - name: Setup Pages
|
44 | 43 | uses: actions/configure-pages@v4
|
| 44 | + |
45 | 45 | - name: Install dependencies
|
46 |
| - run: npm ci # or pnpm install / yarn install / bun install |
| 46 | + run: pnpm install |
| 47 | + |
47 | 48 | - name: Build with VitePress
|
48 | 49 | run: |
|
49 | 50 | npx vitepress build
|
50 | 51 | touch .vitepress/dist/.nojekyll
|
| 52 | +
|
51 | 53 | - name: Upload artifact
|
52 | 54 | uses: actions/upload-pages-artifact@v3
|
53 | 55 | with:
|
54 | 56 | path: .vitepress/dist
|
55 | 57 |
|
56 |
| - # Deploy job |
57 | 58 | deploy:
|
58 | 59 | needs: build
|
59 | 60 | environment:
|
60 | 61 | name: github-pages
|
61 | 62 | url: ${{ steps.deployment.outputs.page_url }}
|
62 | 63 | runs-on: ubuntu-latest
|
63 |
| - name: Deploy |
| 64 | + |
64 | 65 | steps:
|
65 | 66 | - name: Deploy to GitHub Pages
|
66 | 67 | id: deployment
|
|
0 commit comments