Merge pull request #5 from kendryte/fix_bug_toc #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Documents. | |
on: | |
push: | |
branches: [ "main" ] | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Requirements. | |
run: pip3 install sphinx==5.3.0 sphinx_multiversion sphinx_book_theme sphinx_copybutton sphinxcontrib-mermaid myst-parser | |
- name: Build | |
run: | | |
git fetch --unshallow # fetch all history | |
make mhtml | |
find build -type d -name ".doctrees" | xargs rm -rf | |
find build -type f -name ".buildinfo" | xargs rm -rf | |
find build -type f -name "objects.inv" | xargs rm -rf | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: 'build' | |
deploy: | |
needs: build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }}/main | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |