-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,27 +22,46 @@ jobs: | |
install-tex: true | ||
|
||
deploy-docs: | ||
# https://github.com/marketplace/actions/deploy-to-github-pages | ||
needs: build-docs | ||
if: github.event_name != 'pull_request' | ||
needs: docs-make | ||
if: github.repository_owner == 'Lightning-AI' && github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
env: | ||
GCP_TARGET: "gs://lightning-docs-thunder" | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
with: | ||
# If you're using actions/checkout@v4 you must set persist-credentials to false in most cases for the deployment to work correctly. | ||
persist-credentials: false | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: docs-html-${{ github.sha }} | ||
path: docs/build/ | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
- name: Authenticate to Google Cloud | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
credentials_json: ${{ secrets.GCS_SA_KEY }} | ||
|
||
- name: Setup gcloud | ||
uses: google-github-actions/setup-gcloud@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: docs/build/html # The folder the action should deploy. | ||
clean: true # Automatically remove deleted files from the deploy branch | ||
target-folder: docs # If you'd like to push the contents of the deployment folder into a specific directory | ||
single-commit: true # you'd prefer to have a single commit on the deployment branch instead of full history | ||
project_id: ${{ secrets.GCS_PROJECT }} | ||
|
||
# Uploading docs to GCS, so they can be served on lightning.ai | ||
#- name: Upload docs/thunder/stable to GCS 🪣 | ||
# if: startsWith(github.ref, 'refs/heads/release/') | ||
# 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/thunder/latest to GCS 🪣 | ||
if: github.ref == 'refs/heads/master' | ||
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/thunder/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} |