Update docs workflow #2
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: Docs | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
prepare-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: "main" | |
- name: Build documentation | |
run: | | |
sudo apt-get install doxygen | |
$(which python3 || which python) script/icp_doc_builder.py src/icp/ book/icp_descr/ | |
doxygen | |
cp book/desmos.txt docs | |
rm -rf book .vscode src math script install ex_data Doxyfile .clang-format AUTHOR.md INSTALL.md main.cpp Makefile README.md README.md.build sim.conf test.cpp docs | |
- name: Push to docs branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "Deploy documentation" | |
git push origin docs | |
deploy: | |
needs: prepare-docs | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: "docs" | |
- uses: actions/configure-pages@v5 | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "." | |
- id: deployment | |
uses: actions/deploy-pages@v4 |