-
Notifications
You must be signed in to change notification settings - Fork 122
64 lines (64 loc) · 1.91 KB
/
deploy_docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Deploy Docs
on:
push:
branches:
- main
paths-ignore:
- '.vscode/**'
- '.gitignore'
pull_request:
branches:
- main
paths-ignore:
- '.vscode/**'
- '.gitignore'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Cache Huggingface assets
uses: actions/cache@v4
with:
key: huggingface-${{ runner.os }}-3.11-${{ hashFiles('**/pyproject.toml') }}
path: ~/.cache/huggingface
restore-keys: |
huggingface-${{ runner.os }}-3.11-
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}-3.11-0
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-3.11-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
venv-${{ runner.os }}-3.11-
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
- name: Set Python Path
run: echo "PYTHONPATH=$PYTHONPATH:$PWD" >> $GITHUB_ENV
- name: Deploy website
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run mkdocs gh-deploy --force