From 92dc8d4d05a4699ed21d3a8bbe9c364d8d5f0ba8 Mon Sep 17 00:00:00 2001 From: Peter Katarzynski Date: Fri, 26 Jul 2024 16:02:09 +0200 Subject: [PATCH] Add GH automation --- .github/workflows/docs.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..4b9d53d --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,44 @@ +name: CI + +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: [main] + pull_request: + +jobs: + DeployDocs: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + with: + submodules: false + - name: Install dependencies + run: | + sudo apt-get update + python -m pip install -r docs/requirements.txt + - name: Build docs and static demo + run: | + cd docs + PYTHONPATH="/tmp/" make html + - uses: actions/upload-artifact@v3 + with: + name: gh-page + path: docs/build/html + - name: Deploy to Github Pages + if: github.event_name != 'pull_request' + run: | + cd docs/build/html + touch .nojekyll + git init + cp ../../../.git/config ./.git/config + git add . + git config --local user.email "BuildTheDocs@GitHubActions" + git config --local user.name "GitHub Actions" + git commit -am "update ${{ github.sha }}" + git push -u origin +HEAD:gh-pages +