Skip to content

Commit 39302bf

Browse files
authored
ci: upload docs as archive (#18329)
1 parent fcb8e17 commit 39302bf

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/docs-build.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ jobs:
184184
fail-fast: false
185185
matrix:
186186
pkg-name: ["app", "fabric", "pytorch"]
187+
env:
188+
GCP_TARGET: "gs://lightning-docs-${{ matrix.pkg-name }}"
187189
steps:
188190
- uses: actions/download-artifact@v3
189191
with:
@@ -203,14 +205,22 @@ jobs:
203205
# Uploading docs to GCS, so they can be served on lightning.ai
204206
- name: Upload docs/${{ matrix.pkg-name }}/stable to GCS 🪣
205207
if: startsWith(github.ref, 'refs/heads/release/')
206-
run: gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-${{ matrix.pkg-name }}/stable
208+
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/stable
207209

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

213215
# Uploading docs to GCS, so they can be served on lightning.ai
214216
- name: Upload docs/${{ matrix.pkg-name }}/release to GCS 🪣
215217
if: startsWith(github.ref, 'refs/tags/')
216-
run: gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-${{ matrix.pkg-name }}/${{ github.ref_name }}
218+
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/${{ github.ref_name }}
219+
220+
# Uploading docs as archive to GCS, so they can be as backup
221+
- name: Upload docs as archive to GCS 🪣
222+
if: startsWith(github.ref, 'refs/tags/')
223+
working-directory: docs/build
224+
run: |
225+
zip ${{ github.ref_name }}.zip -r html/
226+
gsutil cp ${{ github.ref_name }}.zip ${GCP_TARGET}

0 commit comments

Comments
 (0)