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