deploy-docs.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # This is a basic workflow to help you get started with Actions
  2. name: Deploy GitHub Pages
  3. # Controls when the workflow will run
  4. on:
  5. # Triggers the workflow on push or pull request events but only for the "main" branch
  6. # push:
  7. # tags:
  8. # - "v*"
  9. # Allows you to run this workflow manually from the Actions tab on GitHub.
  10. workflow_dispatch:
  11. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  12. jobs:
  13. # This workflow contains a single job called "build"
  14. build:
  15. # The type of runner that the job will run on
  16. runs-on: ubuntu-latest
  17. # Steps represent a sequence of tasks that will be executed as part of the job
  18. steps:
  19. # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  20. - name: Checkout code
  21. uses: actions/checkout@v4
  22. - name: Setup Node.js
  23. uses: actions/setup-node@v4
  24. with:
  25. node-version: "20"
  26. registry-url: "https://registry.npmjs.org"
  27. - name: Install dependencies
  28. run: npm install
  29. working-directory: ./docs
  30. - name: Run build site
  31. run: npm run build
  32. working-directory: ./docs
  33. - name: Deploy to GitHub Pages
  34. uses: peaceiris/actions-gh-pages@v4
  35. with:
  36. github_token: ${{ secrets.GITHUB_TOKEN }}
  37. publish_dir: ./docs/.vitepress/dist