-
Notifications
You must be signed in to change notification settings - Fork 15
68 lines (58 loc) · 2.28 KB
/
make-docs.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
name: Make Docs
on:
workflow_call:
inputs:
package:
required: true
type: string
version:
required: true
type: string
event_name:
required: false
type: string
default: 'push'
fix_mime_types:
required: false
type: boolean
default: false
jobs:
make-docs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
# assume that the dist artifact is already available from calling build-python-package.yml before this workflow
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist-${{ inputs.package }}
path: plugins/${{ inputs.package }}/dist/
- name: Install requirements
run: pip install -r sphinx_ext/sphinx-requirements.txt
- name: Install wheel
run: pip install plugins/${{ inputs.package }}/dist/*.whl
- name: Run make_docs.py
run: python plugins/${{ inputs.package }}/make_docs.py
- name: Sync to the plugins folder
# pull requests should run the make_docs.py script, but not sync the docs
if: inputs.event_name == 'push'
uses: deephaven/salmon-sync@v1
with:
source: plugins/${{ inputs.package }}/docs/build/markdown/
destination: deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/
project_number: ${{ secrets.DOCS_GOOGLE_CLOUD_PROJECT_NUMBER}}
bucket: ${{ vars.DOCS_GOOGLE_CLOUD_BUCKET }}
credentials: ${{ secrets.DOCS_GOOGLE_CLOUD_CREDENTIALS }}
- name: Setup gsutil auth
if: inputs.fix_mime_types == true
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.DOCS_GOOGLE_CLOUD_CREDENTIALS }}'
- name: Setup gsutil CLI
if: inputs.fix_mime_types == true
uses: 'google-github-actions/setup-gcloud@v2'
- name: Set gsutil markdown mime type
if: inputs.fix_mime_types == true
# some markdown files get set to octet-stream by default, so fix them
run: gsutil -m setmeta -h "Content-Type:text/markdown; charset=utf-8" -r "gs://${{ secrets.DOCS_GOOGLE_CLOUD_BUCKET }}/deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/**/*.md"