Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci/docs: upload with dispatch #19018

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,16 @@ jobs:

deploy-docs:
needs: docs-make
if: github.repository_owner == 'Lightning-AI' && github.event_name == 'push'
if: github.repository_owner == 'Lightning-AI' && github.event_name != 'pull_request'
Borda marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
pkg-name: ["app", "fabric", "pytorch"]
env:
GCP_TARGET: "gs://lightning-docs-${{ matrix.pkg-name }}"
# use input if dispatch or git tag
VERSION: ${{ inputs.version || github.ref_name }}
Borda marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/download-artifact@v3
with:
Expand All @@ -158,28 +160,23 @@ jobs:

# Uploading docs to GCS, so they can be served on lightning.ai
- name: Upload docs/${{ matrix.pkg-name }}/stable to GCS 🪣
if: startsWith(github.ref, 'refs/heads/release/')
if: startsWith(github.ref, 'refs/heads/release/') && github.event_name == 'push'
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/stable

# Uploading docs to GCS, so they can be served on lightning.ai
- name: Upload docs/${{ matrix.pkg-name }}/latest to GCS 🪣
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/latest

# Uploading docs to GCS, so they can be served on lightning.ai
- name: Upload docs/${{ matrix.pkg-name }}/release to GCS 🪣
if: github.event_name == 'workflow_dispatch'
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/${{ inputs.version }}

# Uploading docs to GCS, so they can be served on lightning.ai
- name: Upload docs/${{ matrix.pkg-name }}/release to GCS 🪣
if: startsWith(github.ref, 'refs/tags/')
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/${{ github.ref_name }}
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/${{ env.VERSION }}

# 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/')
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
working-directory: docs/build
run: |
zip ${{ github.ref_name }}.zip -r html/
gsutil cp ${{ github.ref_name }}.zip ${GCP_TARGET}
zip ${{ env.VERSION }}.zip -r html/
gsutil cp ${{ env.VERSION }}.zip ${GCP_TARGET}