deploy.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. with:
  32. package_json_file: docs/package.json
  33. version: 8.15.1
  34. # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
  35. - name: Setup Node
  36. uses: actions/setup-node@v4
  37. with:
  38. node-version: 18.18.2
  39. cache: pnpm # or pnpm / yarn
  40. cache-dependency-path: docs/pnpm-lock.yaml
  41. - name: Setup Pages
  42. uses: actions/configure-pages@v4
  43. - name: Install dependencies and build
  44. shell: bash
  45. run: |
  46. cd docs
  47. pnpm install
  48. pnpm run build
  49. cd ..
  50. - name: Upload artifact
  51. uses: actions/upload-pages-artifact@v3
  52. with:
  53. path: docs/.vitepress/dist
  54. # Deployment job
  55. deploy:
  56. environment:
  57. name: github-pages
  58. url: ${{ steps.deployment.outputs.page_url }}
  59. needs: build
  60. runs-on: ubuntu-latest
  61. name: Deploy
  62. steps:
  63. - name: Deploy to GitHub Pages
  64. id: deployment
  65. uses: actions/deploy-pages@v4