|
1 | | -name: Deploy Docs to GitHub Pages |
2 | | - |
| 1 | +# https://github.com/actions/deploy-pages#usage |
| 2 | +name: Deploy to GitHub Pages |
3 | 3 | on: |
4 | | - # Runs on pushes targeting the default branch |
| 4 | + workflow_dispatch: |
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - main |
8 | | - - master |
9 | | - paths: |
10 | | - - 'docs/**' |
11 | | - - '.github/workflows/deploy-docs.yml' |
12 | | - |
13 | | - # Allows you to run this workflow manually from the Actions tab |
14 | | - workflow_dispatch: |
15 | | - |
16 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
17 | | -permissions: |
18 | | - contents: read |
19 | | - pages: write |
20 | | - id-token: write |
21 | | - actions: read |
22 | | - |
23 | | -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
24 | | -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
25 | | -concurrency: |
26 | | - group: "pages" |
27 | | - cancel-in-progress: false |
28 | | - |
29 | 8 | jobs: |
30 | 9 | build: |
31 | 10 | runs-on: ubuntu-latest |
32 | 11 | defaults: |
33 | 12 | run: |
34 | 13 | working-directory: docs |
35 | 14 | steps: |
36 | | - - uses: actions/checkout@v6.0.2 |
37 | | - |
38 | | - - uses: pnpm/action-setup@v5.0.0 |
39 | | - |
40 | | - - uses: actions/setup-node@v6.4.0 |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - run: corepack enable |
| 17 | + - uses: actions/setup-node@v4 |
41 | 18 | with: |
42 | | - node-version: 24 |
43 | | - cache: pnpm |
44 | | - |
45 | | - - name: Install dependencies |
46 | | - run: pnpm install --frozen-lockfile |
47 | | - |
48 | | - - name: Build with Nuxt |
49 | | - run: pnpm generate |
50 | | - env: |
51 | | - NUXT_APP_BASE_URL: /nuxt-ui-formkit/ |
52 | | - |
53 | | - - name: Deploy |
54 | | - uses: peaceiris/actions-gh-pages@v4 |
| 19 | + node-version: "24" |
| 20 | + # Pick your own package manager and build script |
| 21 | + - run: npm install |
| 22 | + - run: npx nuxt build --preset github_pages |
| 23 | + - name: Upload artifact |
| 24 | + uses: actions/upload-pages-artifact@v3 |
55 | 25 | with: |
56 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
57 | | - publish_dir: ./docs/.output/public |
58 | | - # cname: example.com # if wanna deploy to custom domain |
59 | | - |
| 26 | + path: ./.output/public |
| 27 | + # Deployment job |
| 28 | + deploy: |
| 29 | + # Add a dependency to the build job |
| 30 | + needs: build |
| 31 | + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment |
| 32 | + permissions: |
| 33 | + pages: write # to deploy to Pages |
| 34 | + id-token: write # to verify the deployment originates from an appropriate source |
| 35 | + # Deploy to the github_pages environment |
| 36 | + environment: |
| 37 | + name: github-pages |
| 38 | + url: ${{ steps.deployment.outputs.page_url }} |
| 39 | + # Specify runner + deployment step |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - name: Deploy to GitHub Pages |
| 43 | + id: deployment |
| 44 | + uses: actions/deploy-pages@v4 |
0 commit comments