Skip to content

Commit 8b4d95b

Browse files
committed
add upload main var to control if docs are uploaded to site
1 parent 7ae55b7 commit 8b4d95b

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

.github/workflows/_build-tutorials-base.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ on:
77
description: "Use nightly builds inside build.sh"
88
required: false
99
type: number
10-
default: false
10+
default: 0
11+
UPLOAD_MAIN:
12+
description: "Upload built docs to main site"
13+
required: false
14+
type: number
15+
default: 0
1116

1217
concurrency:
1318
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
@@ -150,6 +155,7 @@ jobs:
150155
COMMIT_SOURCE: ${{ github.ref }}
151156
GITHUB_PYTORCHBOT_TOKEN: ${{ secrets.PYTORCHBOT_TOKEN }}
152157
USE_NIGHTLY: ${{ inputs.USE_NIGHTLY }}
158+
UPLOAD_MAIN: ${{ inputs.UPLOAD_MAIN }}
153159
run: |
154160
set -ex
155161
@@ -164,6 +170,7 @@ jobs:
164170
-e COMMIT_SOURCE \
165171
-e GITHUB_PYTORCHBOT_TOKEN \
166172
-e USE_NIGHTLY \
173+
-e UPLOAD_MAIN \
167174
--env-file="/tmp/github_env_${GITHUB_RUN_ID}" \
168175
--tty \
169176
--detach \

.github/workflows/build-tutorials-nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
secrets: inherit
1717
with:
1818
USE_NIGHTLY: 1
19+
UPLOAD_MAIN: 0

.github/workflows/build-tutorials.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
secrets: inherit
1717
with:
1818
USE_NIGHTLY: 0
19+
UPLOAD_MAIN: 1

.jenkins/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ elif [[ "${JOB_TYPE}" == "manager" ]]; then
154154
awsv2 s3 cp manager.7z s3://${BUCKET_NAME}/${COMMIT_ID}/manager.7z
155155

156156
# Step 7: push new HTML files and static files to gh-pages
157-
if [[ "$COMMIT_SOURCE" == "refs/heads/master" || "$COMMIT_SOURCE" == "refs/heads/main" ]]; then
157+
if [[ "$UPLOAD_MAIN" == 1 && ("$COMMIT_SOURCE" == "refs/heads/master" || "$COMMIT_SOURCE" == "refs/heads/main") ]]; then
158158
git clone https://github.com/pytorch/tutorials.git -b gh-pages gh-pages
159159
# Clean up directories that contain tutorials
160160

0 commit comments

Comments
 (0)