jondy is publishing docs #65
This file contains hidden or 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-docs-actions | |
run-name: ${{ github.actor }} is publishing docs | |
on: | |
push: | |
branches: | |
- master | |
- 'pyarmor/docs/**' | |
# jobs: | |
# test-no-disk: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - run: sudo mv /dev/disk /dev/notdisk | |
# - run: pip install pyarmor | |
# - run: pyarmor -h | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install graphviz and sphinx | |
run: | | |
sudo apt install graphviz | |
pip install sphinx | |
pip install sphinx-rtd-theme | |
pip install linuxdoc | |
- name: Prepare _site | |
run: | | |
mkdir -p _site/pyarmor/{docs,learn} | |
cp index.html _site/ | |
cp pyarmor/index.html _site/pyarmor/ | |
cp -a pyarmor/assets/ _site/pyarmor/assets | |
cp -a pyarmor/ask/ _site/pyarmor/ask | |
cp -a pyarmor/try/ _site/pyarmor/try | |
cp pyarmor/docs/index.html _site/pyarmor/docs/ | |
cp pyarmor/learn/index.html _site/pyarmor/learn/ | |
- name: Build static files for en | |
run: | | |
make html | |
rm -rf ../../../_site/pyarmor/docs/en | |
mv _build/html ../../../_site/pyarmor/docs/en | |
working-directory: ./pyarmor/docs/en | |
- name: Build static files for zh | |
run: | | |
make html | |
rm -rf ../../../_site/pyarmor/docs/zh | |
mv _build/html ../../../_site/pyarmor/docs/zh | |
working-directory: ./pyarmor/docs/zh | |
- name: Build learing files for en | |
run: | | |
make html | |
rm -rf ../../../_site/pyarmor/learn/en | |
mv _build/html ../../../_site/pyarmor/learn/en | |
working-directory: ./pyarmor/learn/en | |
- name: Build learing files for zh | |
run: | | |
make html | |
rm -rf ../../../_site/pyarmor/learn/zh | |
mv _build/html ../../../_site/pyarmor/learn/zh | |
working-directory: ./pyarmor/learn/zh | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: _site/ | |
# Deployment job | |
deploy: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{steps.deployment.outputs.page_url}} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |