Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 14f6d80

Browse files
authored
Update version dropdown when deploying latest Python docs (#10669)
1 parent 7c4d986 commit 14f6d80

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/reusable_deploy_docs.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
process_gcloudignore: false
9494
parent: false
9595

96-
- name: "Update latest"
96+
- name: "Update latest index.html"
9797
if: ${{ inputs.UPDATE_LATEST }}
9898
run: |
9999
cat <<EOF > index.html
@@ -117,6 +117,26 @@ jobs:
117117
118118
gsutil cp ./index.html gs://rerun-docs/docs/python/stable/
119119
120+
- name: "Update versions.json"
121+
if: ${{ inputs.UPDATE_LATEST }}
122+
run: |
123+
VERSION=${{ inputs.PY_DOCS_VERSION_NAME }}
124+
125+
echo "download existing"
126+
gsutil cp gs://rerun-docs/docs/python/versions.json ./
127+
cat versions.json
128+
129+
echo "remove `stable` alias"
130+
jq -c 'map(.aliases |= map(select(. != "stable")))' versions.json > versions.json.new
131+
cat versions.json.new
132+
133+
echo "prepend new version with `stable` alias"
134+
jq -c --arg v "$VERSION" '[{ version: $v, title: $v, aliases: ["stable"] }] + .' versions.json.new > versions.json
135+
cat versions.json
136+
137+
echo "overwrite the file on gcs"
138+
gsutil cp ./versions.json gs://rerun-docs/docs/python/
139+
120140
# ---------------------------------------------------------------------------
121141

122142
cpp-deploy-docs:

0 commit comments

Comments
 (0)