forked from geotribu/website
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.77 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: "🚀 Déploiement"
on:
push:
branches: [master]
paths:
- ".github/workflows/deploy.yml"
- "content/**"
- "mkdocs.yml"
- "requirements.txt"
jobs:
deploy:
name: "📤 GitHub Pages"
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'geotribu' }}
steps:
- name: Get source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: "pip"
- name: Install dependencies
env:
GH_TOKEN_MATERIAL_INSIDERS: ${{ secrets.GH_TOKEN_MATERIAL_INSIDERS }}
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade -r requirements-insiders.txt
python -m pip install --upgrade ghp-import
- name: Cache build dependencies (external assets downloaded)
uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- name: Build static website
run: |
python scripts/mkdocs_config_merger.py -c mkdocs.yml
mkdocs build --clean --config-file mkdocs.yml --verbose --strict
env:
MKDOCS_ENABLE_PLUGIN_GIT_AUTHORS: true
MKDOCS_ENABLE_PLUGIN_GIT_DATES: true
MKDOCS_ENABLE_PLUGIN_PRIVACY: true
MKDOCS_ENABLE_PLUGIN_RSS: true
MKDOCS_GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
- name: Deploy to Github Pages
run: |
git config --global user.name "Geotribu (Github Action)"
git config --global user.email "[email protected]"
ghp-import --force --message="Site Geotribu déployé" --no-jekyll --no-history --push build/mkdocs/site