-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 1.59 KB
/
website.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
name: publish-websites
on:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '15 3 * * *'
jobs:
# Build site
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
run: python -m pip install poetry==1.5.1
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-root
- name: Build site
run: poetry run mkdocs build -d public
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
# Deploy site to Github pages
deploy:
needs: build
if: >
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'schedule')
permissions:
# to deploy to Pages
pages: write
# to verify the deployment originates from an appropriate source
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4