Skip to content

Commit 79c97fb

Browse files
authored
Remove checkout step from doc upload (#1091)
1 parent 3691b8e commit 79c97fb

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.circleci/build_docs/commit_docs.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -ex
55

66
if [ "$2" == "" ]; then
77
echo call as "$0" "<src>" "<target branch>"
8-
echo where src is the built documentation and
8+
echo where src is the root of the built documentation git checkout and
99
echo branch should be "master" or "1.7" or so
1010
exit 1
1111
fi
@@ -15,14 +15,15 @@ target=$2
1515

1616
echo "committing docs from ${src} to ${target}"
1717

18+
pushd $src
1819
git checkout gh-pages
1920
mkdir -p ./"${target}"
2021
rm -rf ./"${target}"/*
21-
cp -r "${src}/build/html/"* ./"$target"
22+
cp -r "${src}/docs/build/html/"* ./"$target"
2223
if [ "${target}" == "master" ]; then
2324
mkdir -p ./_static
2425
rm -rf ./_static/*
25-
cp -r "${src}/build/html/_static/"* ./_static
26+
cp -r "${src}/docs/build/html/_static/"* ./_static
2627
git add --all ./_static || true
2728
fi
2829
git add --all ./"${target}" || true

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,6 @@ jobs:
662662
steps:
663663
- attach_workspace:
664664
at: ~/workspace
665-
- designate_upload_channel
666665
- checkout
667666
- run:
668667
name: Install pytorch-audio
@@ -671,7 +670,7 @@ jobs:
671670
name: Build docs
672671
command: .circleci/build_docs/build_docs.sh
673672
- persist_to_workspace:
674-
root: docs
673+
root: ./
675674
paths:
676675
- "*"
677676

@@ -683,7 +682,6 @@ jobs:
683682
steps:
684683
- attach_workspace:
685684
at: ~/workspace
686-
- designate_upload_channel
687685
- run:
688686
name: Generate netrc
689687
command: |
@@ -694,13 +692,15 @@ jobs:
694692
login pytorchbot
695693
password ${GITHUB_PYTORCHBOT_TOKEN}
696694
DONE
697-
- checkout
698695
- run:
699696
name: Upload docs
700697
command: |
698+
# Don't use "checkout" step since it uses ssh, which cannot git push
699+
# https://circleci.com/docs/2.0/configuration-reference/#checkout
701700
set -ex
702701
echo $PWD
703702
ls ~/workspace
703+
ls ~/workspace/doc
704704
tag=${CIRCLE_TAG:1:5}
705705
target=${tag:-master}
706706
.circleci/build_docs/commit_docs.sh ~/workspace $target

.circleci/config.yml.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,6 @@ jobs:
662662
steps:
663663
- attach_workspace:
664664
at: ~/workspace
665-
- designate_upload_channel
666665
- checkout
667666
- run:
668667
name: Install pytorch-audio
@@ -671,7 +670,7 @@ jobs:
671670
name: Build docs
672671
command: .circleci/build_docs/build_docs.sh
673672
- persist_to_workspace:
674-
root: docs
673+
root: ./
675674
paths:
676675
- "*"
677676

@@ -683,7 +682,6 @@ jobs:
683682
steps:
684683
- attach_workspace:
685684
at: ~/workspace
686-
- designate_upload_channel
687685
- run:
688686
name: Generate netrc
689687
command: |
@@ -694,13 +692,15 @@ jobs:
694692
login pytorchbot
695693
password ${GITHUB_PYTORCHBOT_TOKEN}
696694
DONE
697-
- checkout
698695
- run:
699696
name: Upload docs
700697
command: |
698+
# Don't use "checkout" step since it uses ssh, which cannot git push
699+
# https://circleci.com/docs/2.0/configuration-reference/#checkout
701700
set -ex
702701
echo $PWD
703702
ls ~/workspace
703+
ls ~/workspace/doc
704704
tag=${CIRCLE_TAG:1:5}
705705
target=${tag:-master}
706706
.circleci/build_docs/commit_docs.sh ~/workspace $target

0 commit comments

Comments
 (0)