Skip to content

Commit 72b1d54

Browse files
committed
Publish to the master branch
1 parent 7fad481 commit 72b1d54

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

azure-pipelines.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
trigger:
2-
- master
2+
- src
33

44
jobs:
55
- job: publish
@@ -23,7 +23,15 @@ jobs:
2323
displayName: Install rust
2424
- script: ./ci/build.sh
2525
displayName: Build site
26-
- script: curl -LsSf https://git.io/fhJ8n | rustc - && (cd _site && ../rust_out)
27-
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
26+
- script: |
27+
set -e
28+
source ci/setup-git.sh
29+
cd _site
30+
git init
31+
git add .
32+
git commit -m "Deploy $BUILD_SOURCEVERSION"
33+
git push [email protected]:rustwasm/rustwasm.github.io master:master -f
34+
displayName: "Push to gh-pages"
35+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/src'))
2836
env:
29-
GITHUB_DEPLOY_KEY: $(GITHUB_DEPLOY_KEY)
37+
GITHUB_DEPLOY_KEY: '$(GITHUB_DEPLOY_KEY_MAIN)'

ci/setup-git.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set -e
2+
3+
eval `ssh-agent`
4+
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
5+
echo $GITHUB_DEPLOY_KEY | base64 -d > _the_key
6+
chmod 600 _the_key
7+
ssh-add _the_key
8+
git config --global user.name "Deploy from CI"
9+
git config --global user.email ""

0 commit comments

Comments
 (0)