ci(project): 💚 Use mkdocs insider to generate gh-page #16
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: gh-page | |
on: | |
push: | |
branches: | |
- master | |
- main | |
- dev | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event.repository.fork == false | |
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@v4 | |
with: | |
python-version: "3.11" | |
- name: Cache Poetry and dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pypoetry | |
.venv | |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: latest | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
run: | | |
poetry run pip install --upgrade pip | |
set -e | |
poetry run pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git | |
poetry install | |
- name: Deploy documentation | |
run: poetry run mkdocs gh-deploy --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |