diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml new file mode 100644 index 00000000..f4f8d2bd --- /dev/null +++ b/.github/workflows/gh-pages.yaml @@ -0,0 +1,36 @@ +name: Github Pages + +on: + push: + branches: + - main + paths: + - "docs/**" + pull_request: + paths: + - "docs/**" + +jobs: + deploy: + runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v2 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: '0.4.10' + + - name: Install Katex + run: cargo install mdbook-katex + + - run: mdbook build docs + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/book \ No newline at end of file