|
1 | | -# Sample workflow for building and deploying a VitePress site to GitHub Pages |
2 | | -# |
3 | | -name: Deploy VitePress site to Pages |
| 1 | +name: Deploy docs (Fumadocs/Next.js) 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 |
12 | 7 | workflow_dispatch: |
13 | 8 |
|
14 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
15 | 9 | permissions: |
16 | 10 | contents: read |
17 | 11 | pages: write |
18 | 12 | id-token: write |
19 | 13 |
|
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 | 14 | concurrency: |
23 | 15 | group: pages |
24 | 16 | cancel-in-progress: false |
25 | 17 |
|
26 | 18 | jobs: |
27 | | - # Build job |
28 | 19 | build: |
29 | 20 | runs-on: ubuntu-latest |
30 | 21 | steps: |
31 | 22 | - name: Checkout |
32 | 23 | uses: actions/checkout@v4 |
33 | 24 | with: |
34 | | - fetch-depth: 0 # Not needed if lastUpdated is not enabled |
| 25 | + fetch-depth: 0 |
| 26 | + |
35 | 27 | - name: Setup Node |
36 | 28 | uses: actions/setup-node@v4 |
37 | 29 | with: |
38 | 30 | node-version: 20 |
39 | | - cache: yarn # or pnpm / yarn |
| 31 | + cache: npm |
| 32 | + |
40 | 33 | - name: Setup Pages |
41 | 34 | uses: actions/configure-pages@v4 |
| 35 | + |
42 | 36 | - name: Install dependencies |
43 | | - run: yarn install # or pnpm install / yarn install / bun install |
44 | | - - name: Build with VitePress |
45 | | - run: yarn docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build |
46 | | - - name: Ensure static assets are copied |
47 | | - run: | |
48 | | - # Make sure the favicon is properly copied |
49 | | - if [ -f "public/favicon.ico" ] && [ ! -f ".vitepress/dist/favicon.ico" ]; then |
50 | | - cp public/favicon.ico .vitepress/dist/ |
51 | | - fi |
52 | | - # Copy all public files not already in dist |
53 | | - for file in public/*; do |
54 | | - filename=$(basename "$file") |
55 | | - if [ ! -f ".vitepress/dist/$filename" ]; then |
56 | | - cp "$file" .vitepress/dist/ |
57 | | - fi |
58 | | - done |
| 37 | + run: npm ci |
| 38 | + |
| 39 | + - name: Build static site |
| 40 | + run: npm run build |
| 41 | + |
59 | 42 | - name: Upload artifact |
60 | 43 | uses: actions/upload-pages-artifact@v3 |
61 | 44 | with: |
62 | | - path: .vitepress/dist |
| 45 | + path: ./out |
63 | 46 |
|
64 | 47 | # Deployment job |
65 | 48 | deploy: |
|
0 commit comments