-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (62 loc) · 1.99 KB
/
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
65
66
67
68
69
70
71
72
73
74
name: Documentation
on:
push:
paths:
- docs/**
- mkdocs.yml
- pyproject.toml
- .github/workflows/docs.yml
workflow_dispatch:
jobs:
build:
name: Build Documentation
environment: main
runs-on: ubuntu-latest
steps:
- name: Mask Secrets
run: echo "::add-mask::${{ secrets.FONTAWESOME_PKG_TOKEN }}"
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: 3.11.1
- name: Set Up Poetry
run: pipx install poetry==1.8.2
- name: Set Up Cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Dependencies
run: poetry install --only main,docs && poetry run icl install
env:
POETRY_REPOSITORIES_MATERIAL_INSIDERS_URL: https://github.com/squidfunk/mkdocs-material-insiders
POETRY_HTTP_BASIC_MATERIAL_INSIDERS_USERNAME: celsiusnarhwal
POETRY_HTTP_BASIC_MATERIAL_INSIDERS_PASSWORD: ${{ secrets.GH_PAT }}
FONTAWESOME_PKG_TOKEN: ${{ secrets.FONTAWESOME_PKG_TOKEN }}
- name: Build Documentation
run: poetry run mkdocs build
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: site
path: site
deploy:
name: Deploy Documentation
environment: main
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: site
path: site
- name: Deploy to Vercel
run: npx vercel --yes --cwd site --token ${{ secrets.VERCEL_TOKEN }} ${{ github.ref_name == 'main' && '--prod' || '' }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}