0.8.2 #120
Workflow file for this run
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] | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
# if: github.ref == 'refs/heads/master' | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python # Set Python version | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
poetry config virtualenvs.create false | |
poetry install -v | |
- name: Build docs | |
run: | | |
python -m pip install -r docs/requirements.txt | |
cd docs | |
cp ../README.md index.md | |
cd .. | |
mkdocs build | |
if : success() | |
- name: Deploy docs | |
run: | | |
mkdocs gh-deploy --clean --force | |
if: success() && (github.ref == 'refs/heads/master' || contains(github.event.head_commit.message, '[docs]')) | |
fix-index: | |
needs: docs | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- name: Fix index.html | |
run: | | |
echo ':: head of index.html - before ::' | |
head index.html | |
sed -i '1,5{/^$/d}' index.html | |
echo ':: head of index.html - after ::' | |
head index.html | |
if: success() | |
- name: Commit changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git commit -m "Add changes" -a | |
if: success() | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
if: success() |