deploy.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Sample workflow for building and deploying a VitePress site to GitHub Pages
  2. #
  3. name: Deploy VitePress site to Pages
  4. on:
  5. # Runs on pushes targeting the `main` branch. Change this to `master` if you're
  6. # using the `master` branch as the default branch.
  7. push:
  8. branches: [main]
  9. # Allows you to run this workflow manually from the Actions tab
  10. workflow_dispatch:
  11. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  12. permissions:
  13. contents: read
  14. pages: write
  15. id-token: write
  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. concurrency:
  19. group: pages
  20. cancel-in-progress: false
  21. jobs:
  22. # Build job
  23. build:
  24. runs-on: ubuntu-latest
  25. steps:
  26. - name: Checkout
  27. uses: actions/checkout@v4
  28. with:
  29. fetch-depth: 0 # Not needed if lastUpdated is not enabled
  30. - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
  31. # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
  32. - name: Setup Node
  33. uses: actions/setup-node@v4
  34. with:
  35. node-version: 20
  36. cache: pnpm # or pnpm / yarn
  37. - name: Setup Pages
  38. uses: actions/configure-pages@v4
  39. - name: Install dependencies
  40. run: pnpm install # or pnpm install / yarn install / bun install
  41. - name: Build with VitePress
  42. run: pnpm docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
  43. - name: Upload artifact
  44. uses: actions/upload-pages-artifact@v3
  45. with:
  46. path: docs/.vitepress/dist
  47. # Deployment job
  48. deploy:
  49. environment:
  50. name: github-pages
  51. url: ${{ steps.deployment.outputs.page_url }}
  52. needs: build
  53. runs-on: ubuntu-latest
  54. name: Deploy
  55. steps:
  56. - name: Deploy to GitHub Pages
  57. id: deployment
  58. uses: actions/deploy-pages@v4