name: Deploy on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest permissions: contents: write # To push a branch pull-requests: write # To create a PR from that branch steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up python uses: actions/setup-python@v4 with: python-version: '3.11' - name: Load cached Poetry installation id: cached-poetry uses: actions/cache@v3 with: path: ~/.local # the path depends on the OS key: poetry-0 # increment to reset cache - name: Install poetry uses: snok/install-poetry@v1 if: steps.cached-poetry.outputs.cache-hit != 'true' with: virtualenvs-create: true virtualenvs-in-project: true version: latest - name: Load cached venv id: cached-poetry-dependencies uses: actions/cache@v2 with: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies run: poetry install --no-root # if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - name: build docs run: | poetry run sphinx-build -M html src build touch build/html/.nojekyll - name: deploy to gh-pages uses: JamesIves/github-pages-deploy-action@v4 with: folder: build/html