22
33set -e
44
5- if [ -z " $GH_TOKEN " ]
5+ if [ -z " $TOKEN " ]
66then
77 echo " You must provide the action with a GitHub Personal Access Token secret in order to deploy."
88 exit 1
@@ -56,7 +56,7 @@ git config --global http.version HTTP/1.1
5656git config --global http.postBuffer 157286400
5757
5858# # Initializes the repository path using the access token.
59- REPOSITORY_PATH=" https://${GH_TOKEN } @github.com/${TARGET_REPOSITORY} .git" && \
59+ REPOSITORY_PATH=" https://${TOKEN } @github.com/${TARGET_REPOSITORY} .git" && \
6060
6161# Checks to see if the remote exists prior to deploying.
6262# If the branch doesn't exist it gets created here as an orphan.
7171 touch README.md && \
7272 git add README.md && \
7373 git commit -m " Initial ${BRANCH} commit" && \
74- git push " https://$GITHUB_ACTOR :$GH_TOKEN @github.com/$TARGET_REPOSITORY .git" $BRANCH
74+ git push " https://$GITHUB_ACTOR :$TOKEN @github.com/$TARGET_REPOSITORY .git" $BRANCH
7575else
7676 # # Clone the target repository
7777 git clone " $REPOSITORY_PATH " $DOC_FOLDER --branch $BRANCH --single-branch && \
9393# Commits the data to Github.
9494if [ -z " $VERSION " ]
9595then
96- echo " No Version. Publishing Snapshot of Docs "
96+ echo " No Version. Publishing Docs to Root "
9797 if [ -n " ${DOC_SUB_FOLDER} " ]; then
98- mkdir -p snapshot/ $DOC_SUB_FOLDER
99- cp -r " ../$FOLDER /." ./snapshot/ $DOC_SUB_FOLDER /
100- git add snapshot/ $DOC_SUB_FOLDER /*
98+ mkdir -p $DOC_SUB_FOLDER
99+ cp -r " ../$FOLDER /." ./$DOC_SUB_FOLDER /
100+ git add $DOC_SUB_FOLDER /*
101101 else
102- mkdir -p snapshot
103- cp -r " ../$FOLDER /." ./snapshot/
104- git add snapshot/*
102+ cp -r " ../$FOLDER /." ./
103+ git add *
105104 fi
106105else
107106 echo " Publishing $VERSION of Docs"
145144
146145
147146git commit -m " Deploying to ${BRANCH} - $( date +" %T" ) " --quiet && \
148- git push " https://$GITHUB_ACTOR :$GH_TOKEN @github.com/$TARGET_REPOSITORY .git" $BRANCH || true && \
147+ git push " https://$GITHUB_ACTOR :$TOKEN @github.com/$TARGET_REPOSITORY .git" $BRANCH || true && \
149148echo " Deployment successful!"
0 commit comments