forked from Gothic-Modding-Community/gmc
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.5 KB
/
dev.build.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
name: Dev Site
on:
push:
branches:
- dev
env:
GMC_ENABLE_ON_PUBLISH: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install Checkout
uses: actions/checkout@v3
with:
# Number of commits to fetch. 0 indicates all history.
# Default: 1
# 0 is needed for the update time plugin to work properly
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
- name: Process Python Cache
id: cache-venv
uses: actions/cache@v3
with:
path: venv
key: requirements-${{ hashFiles('requirements*.txt') }}
- name: Create `venv` and Install Requirements
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-deploy.txt
- name: Prepare `mkdocs.yml`
run: python prepare_mkdocs.py
- name: Run prebuild tests
run: |
source venv/bin/activate
python -m unittest discover tests/ -v
- name: Process MkDocs Material Cache
uses: actions/cache@v3
with:
path: .cache
key: mkdocs-material-${{ hashFiles('test-run.log') }}
- name: Build and deploy site
run: |
source venv/bin/activate
mkdocs gh-deploy --force --remote-branch gh-dev-page