Skip to content

Commit

Permalink
docs: inject version selector to HTML docs (#2886)
Browse files Browse the repository at this point in the history
* docs: inject version selector to HTML docs

* Apply suggestions from code review
  • Loading branch information
Borda authored Jan 6, 2025
1 parent 714494b commit ec3fbf2
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,26 @@ jobs:
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCS_SA_KEY }}

- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCS_PROJECT }}

# Uploading docs as archive to GCS, so they can be as backup
- name: Upload docs as archive to GCS 🪣
if: startsWith(github.ref, 'refs/tags/')
working-directory: docs/build
run: |
zip ${{ github.ref_name }}.zip -r html/
gsutil cp ${{ github.ref_name }}.zip ${GCP_TARGET}
- name: Inject version selector
working-directory: docs/build
run: |
pip install -q wget
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/inject-selector-script.py
python inject-selector-script.py html torchmetrics
# Uploading docs to GCS, so they can be served on lightning.ai
- name: Upload docs/metrics/stable to GCS 🪣
if: startsWith(github.ref, 'refs/heads/release/')
Expand All @@ -118,11 +132,3 @@ jobs:
- name: Upload docs/metrics/release to GCS 🪣
if: startsWith(github.ref, 'refs/tags/')
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/${{ github.ref_name }}

# Uploading docs as archive to GCS, so they can be as backup
- name: Upload docs as archive to GCS 🪣
if: startsWith(github.ref, 'refs/tags/')
working-directory: docs/build
run: |
zip ${{ github.ref_name }}.zip -r html/
gsutil cp ${{ github.ref_name }}.zip ${GCP_TARGET}

0 comments on commit ec3fbf2

Please sign in to comment.