-
Notifications
You must be signed in to change notification settings - Fork 23
59 lines (47 loc) · 1.51 KB
/
docs-publish.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
name: Publish Docs
on:
workflow_dispatch:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./docs"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install client and dependencies
working-directory: "./"
run: |
python -m pip install --upgrade pip setuptools
pip install .
- name: Install docs dependencies
run: |
pip install -r requirements-docs.txt
- name: Build documentation
run: make html
# - name: Upload docs as artifact
# uses: actions/upload-artifact@v3
# with:
# name: docs
# path: docs/build
- name: Authenticate with Google
uses: "google-github-actions/auth@v2"
with:
project_id: ${{ secrets.GCS_PROJECT }}
credentials_json: ${{ secrets.GCS_SERVICE_ACCOUNT_ACCESS_KEY }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Upload to Google Cloud Storage
env:
UPLOAD_PATH: ${{ format('gs://{0}/docs/client', secrets.DOCS_BUCKET) }}
run: gsutil -m rsync -d -r build/html $UPLOAD_PATH
- name: Invalidate CDN Cache
env:
LOAD_BALANCER: ${{ secrets.LOAD_BALANCER_NAME }}
run: gcloud compute url-maps invalidate-cdn-cache $LOAD_BALANCER --async --path "/docs/client/*"