deploy.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #
  22. jobs:
  23. # Build job
  24. build:
  25. runs-on: ubuntu-latest
  26. steps:
  27. - name: Checkout
  28. uses: actions/checkout@v4
  29. with:
  30. fetch-depth: 0
  31. - name: Setup pnpm
  32. uses: pnpm/action-setup@v3
  33. with:
  34. package_json_file: docs/package.json
  35. version: 9
  36. - name: Setup Node
  37. uses: actions/setup-node@v4
  38. with:
  39. node-version: 20
  40. cache-dependency-path: docs/pnpm-lock.yaml
  41. cache: pnpm
  42. - name: Setup Pages
  43. uses: actions/configure-pages@v4
  44. - name: Install Dependencies and Build
  45. shell: bash
  46. run: |
  47. cd docs
  48. pnpm install --frozen-lockfile
  49. pnpm run build
  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