-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.36 KB
/
deploy.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
name: Deploy MkDocs to GitHub Pages
on:
push:
branches:
- main # Change to your main branch if different
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To allow write access to the repository
pages: write # To allow publishing to GitHub Pages
id-token: write # To verify the source of the deployment
steps:
- name: Check out the repository
uses: actions/checkout@v2
- name: Cache Python packages
uses: actions/cache@v3 # Updated to the latest version
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} # Unique key based on OS and requirements
restore-keys: |
${{ runner.os }}-pip- # Restore keys for cache fallback
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9' # Specify the Python version you need
- name: Install dependencies
run: |
pip install -r requirements.txt # Install dependencies from requirements.txt
- name: Build the documentation
run: mkdocs build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site # The default output directory for MkDocs