deploy-docs.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. branches: main
  8. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  9. jobs:
  10. # This workflow contains a single job called "build"
  11. build:
  12. # The type of runner that the job will run on
  13. runs-on: ubuntu-latest
  14. # Steps represent a sequence of tasks that will be executed as part of the job
  15. steps:
  16. # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  17. - name: Checkout code
  18. uses: actions/checkout@v4
  19. - name: Setup Node.js
  20. uses: actions/setup-node@v4
  21. with:
  22. node-version: "20"
  23. registry-url: "https://registry.npmjs.org"
  24. - name: Install dependencies
  25. run: npm install
  26. working-directory: ./docs
  27. - name: Run build site
  28. run: npm run build
  29. working-directory: ./docs
  30. - name: Deploy to GitHub Pages
  31. uses: peaceiris/actions-gh-pages@v4
  32. with:
  33. github_token: ${{ secrets.GITHUB_TOKEN }}
  34. publish_dir: ./docs/dist