-
Notifications
You must be signed in to change notification settings - Fork 52
60 lines (52 loc) · 1.52 KB
/
main.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
name: CI
on:
push:
paths:
- .github/workflows/main.yml
- mkdocs.yml
- 'docs/**'
- 'custom_theme_overrides/**'
- pyproject.toml
- poetry.lock
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.11
architecture: x64
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- name: Install all dependencies
run: |
poetry install \
--no-dev \
--no-interaction \
--ansi \
--remove-untracked
- name: Build documentation
run: |
poetry run mkdocs build --strict
# Synchronize doctree with Google Cloud Bucket
- if: github.ref == 'refs/heads/main'
uses: actions-hub/[email protected]
env:
PROJECT_ID: aura-prod-d7e3
APPLICATION_CREDENTIALS: ${{ secrets.GCP_SERVICEACCOUNT_KEY_FOR_DOC_NAIS_IO_BUCKET }}
with:
args: -m rsync -r -c -d site/ gs://doc.nais.io
cli: gsutil
# Cache buster
- if: github.ref == 'refs/heads/main'
uses: actions-hub/[email protected]
env:
PROJECT_ID: aura-prod-d7e3
APPLICATION_CREDENTIALS: ${{ secrets.GCP_SERVICEACCOUNT_KEY_FOR_DOC_NAIS_IO_BUCKET }}
with:
args: -m setmeta -r -h 'Cache-Control:public, max-age=180' 'gs://doc.nais.io/*'
cli: gsutil