Skip to content

Commit d6d5c66

Browse files
Uploading docs to GitHub pages in the same way as travis
1 parent a225d44 commit d6d5c66

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

azure-pipelines.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,26 +129,32 @@ jobs:
129129
130130
- script: |
131131
if [ "$(Build.SourceBranch)" == "refs/heads/master" ]; then
132-
export NAME="master"
133-
else
134-
export NAME=$(System.PullRequest.PullRequestId)
132+
mkdir -p $REPO_DIR
133+
rm -rf $REPO_DIR/*
134+
cp -r doc/build/html/* $REPO_DIR/
135+
cd $REPO_DIR
136+
git config --global user.email "[email protected]"
137+
git config --global user.name "pandas-docs-bot"
138+
git init
139+
touch README
140+
git add README
141+
git commit -m "Initial commit" --allow-empty
142+
git branch gh-pages
143+
git checkout gh-pages
144+
touch .nojekyll
145+
git add --all .
146+
git commit -m "Version" --allow-empty
147+
git remote remove origin
148+
git remote add origin "https://${TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
149+
git fetch origin
150+
git remote -v
151+
git push origin gh-pages -f
135152
fi
136-
export PR_DIR=$REPO_DIR/pr/$NAME
137-
git clone https://$(GITHUB_DOC_TOKEN)@github.com/pandas-dev/pandas-docs-travis.git $REPO_DIR
138-
mkdir -p $PR_DIR
139-
rm -rf $PR_DIR/*
140-
cp -r doc/build/html/* $PR_DIR/
141-
cp LICENSE $PR_DIR/
142-
cd $REPO_DIR
143-
git add --all .
144-
git config user.email "pandas-docs-bot@localhost"
145-
git config user.name "pandas-docs-bot"
146-
git commit -m "Added pandas documentation for $NAME"
147-
git push
148153
displayName: 'Publishing docs (GitHub pages)'
149154
condition: true
150155
env:
151156
REPO_DIR: $(Build.ArtifactStagingDirectory)/pandas-docs-travis
157+
TOKEN: $(GITHUB_DOCS_TOKEN)
152158
153159
- script: |
154160
export PATH=$HOME/miniconda3/bin:$PATH

0 commit comments

Comments
 (0)