11name : Manual Publish Docs
22on :
33 workflow_dispatch :
4+ inputs :
5+ workspace_path :
6+ description : ' Path to the workspace being released.'
7+ required : true
8+ type : choice
9+ options :
10+ - sdk/highlight-run
11+ - ' sdk/@launchdarkly/observability-node'
12+ - ' sdk/@launchdarkly/observability-python'
13+ workflow_call :
14+ inputs :
15+ workspace_path :
16+ description : ' Path to the workspace being released.'
17+ required : true
18+ type : string
419
520permissions :
6- id-token : write
721 contents : write
822concurrency : ${{ github.workflow }}-${{ github.ref }}
923jobs :
@@ -14,23 +28,86 @@ jobs:
1428 uses : actions/checkout@v4
1529 - run : git submodule update --init --recursive
1630
31+ - name : Check if JS package
32+ id : check-js-package
33+ run : |
34+ if ./scripts/is-js-package.sh ${{ inputs.workspace_path }}; then
35+ echo "is_js_package=true" >> $GITHUB_OUTPUT
36+ else
37+ echo "is_js_package=false" >> $GITHUB_OUTPUT
38+ fi
39+
40+ - name : Check if python package
41+ id : check-python-package
42+ run : |
43+ if ./scripts/is-python-package.sh ${{ inputs.workspace_path }}; then
44+ echo "is_python_package=true" >> $GITHUB_OUTPUT
45+ else
46+ echo "is_python_package=false" >> $GITHUB_OUTPUT
47+ fi
48+
1749 - name : Setup Node.js environment
50+ if : ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
1851 uses : actions/setup-node@v4
1952 with :
2053 node-version : lts/*
2154 cache : ' yarn'
2255
2356 - name : Install js dependencies
57+ if : ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
2458 run : yarn install --mode=skip-build
2559 env :
2660 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD : true
2761
28- - name : Build docs
29- run : yarn docs --filter highlight.run
62+ - name : ' Set WORKSPACE_NAME variable'
63+ if : ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
64+ shell : bash
65+ run : |
66+ WORKSPACE_NAME=$(./scripts/package-name.sh ${{ inputs.workspace_path }})
67+ echo "WORKSPACE_NAME=$WORKSPACE_NAME" >> $GITHUB_ENV
68+
69+ - name : Build JS package docs
70+ if : ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
71+ run : yarn docs --filter ${{ env.WORKSPACE_NAME }}
3072
31- - uses : launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
32- name : ' Publish to Github pages'
73+ - uses : actions/setup-python@v5
74+ if : ${{ steps.check-python-package.outputs.is_python_package == 'true' }}
75+ with :
76+ python-version : ' 3.10'
77+
78+ - name : Install poetry
79+ if : ${{ steps.check-python-package.outputs.is_python_package == 'true' }}
80+ uses : abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
81+
82+ - name : Make Install
83+ # Assume non-js projects will use a Makefile to install dependencies.
84+ # Or an empty install target.
85+ if : ${{ steps.check-js-package.outputs.is_js_package == 'false' }}
86+ run : |
87+ cd ${{ inputs.workspace_path }}
88+ make install
89+
90+ - name : Build Makefile Docs
91+ # Assume non-js projects will use a Makefile to build docs.
92+ if : ${{ steps.check-js-package.outputs.is_js_package == 'false' }}
93+ run : |
94+ cd ${{ inputs.workspace_path }}
95+ make docs
96+
97+ - name : Publish Highlight.run as Observability Plugin
98+ if : inputs.workspace_path == 'sdk/highlight-run'
99+ uses : launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
33100 with :
34101 docs_path : sdk/highlight-run/docs
35102 output_path : packages/@launchdarkly/observability
36103 github_token : ${{ secrets.GITHUB_TOKEN }}
104+
105+ - name : Publish Docs
106+ # This is generalized to work with any package, but we don't use it for highlight-run,
107+ # because we publish its docs to a different path.
108+ if : inputs.workspace_path != 'sdk/highlight-run'
109+ uses : launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
110+ with :
111+ docs_path : ${{ inputs.workspace_path }}/docs
112+ output_path : ${{ inputs.workspace_path }}
113+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments