refiners/.github/workflows/docs.yml
Cédric Deltheil 3a9cd95615 docs.yml: revamp workflow
Adapted from the Material for MkDocs template[1]. The former workflow
was using mkdocs-deploy-gh-pages[2] which runs in an Alpine-based Docker
container preventing from installing PyTorch (needed for mkdocstrings).

[1]:
https://squidfunk.github.io/mkdocs-material/publishing-your-site/#with-github-actions
[2]:
https://github.com/mhausenblas/mkdocs-deploy-gh-pages
2024-02-01 15:45:45 +01:00

38 lines
911 B
YAML

name: Deploy docs to GitHub Pages
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v4
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Install Python
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Handle cache
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install MkDocs dependencies
- run: pip install -r requirements.docs.txt
- name: Deploy to GitHub Pages
- run: mkdocs gh-deploy --force