.github/workflows/deploy.yml #11
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
# Based of: https://github.com/eeholmes/readthedoc-test | |
on: | |
workflow_run: | |
workflows: [tests] | |
types: [completed] | |
branches: [main] | |
jobs: | |
deploy_docs_job: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry==1.7.1 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: poetry install --with docs --all-extras | |
- name: make the sphinx docs | |
run: | | |
poetry run make -C docs clean | |
poetry run make -C docs html | |
- name: Init new repo in dist folder and commit generated files | |
run: | | |
cd docs/_build/html/ | |
git init | |
touch .nojekyll | |
git add -A | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git commit -m 'deploy' | |
- name: Force push to destination branch | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
force: true | |
directory: ./docs/_build/html |