11name : " Deploy Docs"
22on :
33 push :
4- branches : ["release/stable"]
4+ branches : ["master", "release/stable"]
5+
6+ env :
7+ FREEZE_REQUIREMENTS : 1
8+
9+ defaults :
10+ run :
11+ shell : bash
512
613jobs :
714 # https://github.com/marketplace/actions/deploy-to-github-pages
1724 with :
1825 python-version : 3.8
1926
20- - id : ' auth'
21- name : ' Authenticate to Google Cloud'
22- uses : ' google-github-actions/auth@v0'
23- with :
24- credentials_json : ${{ secrets.GCS_SA_KEY }}
25-
26- - name : Setup gcloud
27- uses : ' google-github-actions/setup-gcloud@v0'
28- with :
29- project_id : ${{ secrets.GCS_PROJECT }}
30-
3127 # Note: This uses an internal pip API and may not always work
3228 # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
3329 - name : Cache pip
@@ -39,16 +35,13 @@ jobs:
3935 ${{ runner.os }}-deploy-docs-pip-
4036
4137 - name : Install package & dependencies
42- env :
43- FREEZE_REQUIREMENTS : 1
4438 run : |
4539 sudo apt-get update
4640 sudo apt-get install -y cmake pandoc
41+ sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
4742 pip --version
4843 pip install -e . --quiet -r requirements/app/docs.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
49- sudo apt-get update && sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
5044 pip list
51- shell : bash
5245
5346 - name : Make Documentation
5447 working-directory : ./docs/source-app
@@ -63,13 +56,30 @@ jobs:
6356 token : ${{ secrets.GITHUB_TOKEN }}
6457 branch : gh-pages # The branch the action should deploy to.
6558 folder : docs/build/html # The folder the action should deploy.
66- clean : true # Automatically remove deleted files from the deploy branch
59+ clean : true # Automatically remove deleted files from deploy branch
6760 target-folder : docs # If you'd like to push the contents of the deployment folder into a specific directory
6861 single-commit : true # you'd prefer to have a single commit on the deployment branch instead of full history
6962 if : success()
7063
71- # Uploading docs to GCS so they can be served on lightning.ai
72- - name : Upload to GCS 🪣
64+ - id : ' auth'
65+ name : ' Authenticate to Google Cloud'
66+ uses : google-github-actions/auth@v0
67+ with :
68+ credentials_json : ${{ secrets.GCS_SA_KEY }}
69+
70+ - name : Setup gcloud
71+ uses : google-github-actions/setup-gcloud@v0
72+ with :
73+ project_id : ${{ secrets.GCS_PROJECT }}
74+
75+ # Uploading docs to GCS, so they can be served on lightning.ai
76+ - name : Upload docs/stable to GCS 🪣
77+ if : ${{ success() && startsWith(github.ref, 'refs/heads/release/')) }}
7378 run : |-
74- gsutil -m rsync -d -R docs/build/html/ gs://${{ secrets.GCS_BUCKET }}
75- if : success()
79+ gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-stable
80+
81+ # Uploading docs to GCS, so they can be served on lightning.ai
82+ - name : Upload docs/latest to GCS 🪣
83+ if : ${{ success() && github.ref == 'refs/heads/master' }}
84+ run : |-
85+ gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-latest
0 commit comments