Update docs-publing.yml #12
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 Building & Pushing | |
on: | |
push: | |
branches: [ "docs-source" ] | |
pull_request: | |
branches: [ "docs-source" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
submodules: recursive | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Pull `docs` | |
run: | | |
cd site; | |
git pull; | |
cd ..; | |
- name: Clear `docs` | |
run: | | |
python clearing.py | |
- name: Build `docs` | |
run: | | |
mkdocs build | |
- name: Push `docs` | |
run: | | |
cd site; | |
git commit -a -m "Update docs"; | |
git push origin HEAD:docs; | |
cd ..; |