-
Notifications
You must be signed in to change notification settings - Fork 52
79 lines (71 loc) · 2.05 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build and publish doc
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for git date plugin
- name: Create cached folder
uses: actions/cache@v4
with:
path: out
key: ${{ github.sha }}
- name: Install poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: x64
cache: poetry
- name: Install all dependencies
run: |
poetry install \
--no-dev \
--no-interaction \
--ansi \
--remove-untracked
- name: Build documentation
run: |
./build.sh nav ssb ci-nais dev-nais tenant
publish:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
tenant:
- name: ci-nais
bucket: doc.ci-nais.cloud.nais.io
- name: dev-nais
bucket: doc.dev-nais.cloud.nais.io
- name: nav
bucket: doc.nav.cloud.nais.io
- name: nav
bucket: docs.nais.io
- name: ssb
bucket: doc.ssb.cloud.nais.io
steps:
- name: Restore cache folder
uses: actions/cache/restore@v4
with:
path: out
key: ${{ github.sha }}
- name: Sync documentation to bucket
uses: actions-hub/[email protected]
env:
PROJECT_ID: not-used
APPLICATION_CREDENTIALS: ${{ secrets.NAIS_DOC_SA }}
with:
args: -m rsync -r -c -d out/${{matrix.tenant.name}}/ gs://${{ matrix.tenant.bucket }}
cli: gsutil
- name: Invalidate cache
uses: actions-hub/[email protected]
env:
PROJECT_ID: not-used
APPLICATION_CREDENTIALS: ${{ secrets.NAIS_DOC_SA }}
with:
args: -m setmeta -r -h 'Cache-Control:public, max-age=180' 'gs://${{ matrix.tenant.bucket }}/*'
cli: gsutil