diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index fbaec99..8630c2c 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -1,28 +1,39 @@ name: Build docs + on: push: branches: - main -permissions: - contents: write + jobs: - deploy: - runs-on: ubuntu-latest + build: + strategy: + matrix: + python-version: [ 3.11 ] + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - name: Configure Git Credentials - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - uses: actions/setup-python@v5 + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 with: - python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v4 + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install . + python -m pip install -r docs/requirements.txt + + - name: Build docs + run: | + mkdocs build + mkdocs build # twice, see https://github.com/patrick-kidger/pytkdocs_tweaks + + - name: Upload docs + uses: actions/upload-artifact@v2 with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - run: pip install mkdocs-material - - run: mkdocs gh-deploy --force \ No newline at end of file + name: docs + path: site # where `mkdocs build` puts the built site \ No newline at end of file