site.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Site
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. env:
  7. SITE_DIR: "site"
  8. jobs:
  9. buildAnDeploySite:
  10. name: "Build site with mkdocs"
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. python-version:
  15. - 3.10.0
  16. steps:
  17. - name: Checkout
  18. uses: actions/checkout@v2
  19. - name: Set up Python ${{ matrix.python-version }}
  20. uses: actions/setup-python@v2
  21. with:
  22. python-version: ${{ matrix.python-version }}
  23. - name: Install dependencies
  24. run: |
  25. python -m pip install --upgrade pip
  26. pip install mkdocs mkdocs-material
  27. if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  28. - name: Build Site
  29. run: |
  30. mkdocs build
  31. - name: Deploy Site
  32. id: deploy_site
  33. uses: peaceiris/actions-gh-pages@v3
  34. with:
  35. github_token: ${{ secrets.GITHUB_TOKEN }}
  36. publish_dir: "${{ env.SITE_DIR }}"
  37. publish_branch: "gh-pages"
  38. full_commit_message: "[Release]${{ github.event.head_commit.message }}"