forked from alexwlchan/alexwlchan.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
35 lines (26 loc) · 935 Bytes
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
trigger:
- "master"
pr:
- "master"
pool:
vmImage: "Ubuntu-16.04"
steps:
- script: "make build"
displayName: "Run 'jekyll build'"
- script: |
mkdir -p ~/.ssh
echo "-----BEGIN OPENSSH PRIVATE KEY-----" > ~/.ssh/id_rsa
echo -e "${SSH_KEY// /'\n'}" >> ~/.ssh/id_rsa
echo "-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
touch ~/.gitconfig
git config --global user.name "Azure Pipelines on behalf of Alex Chan"
git config --global user.email "[email protected]"
make deploy
git remote add ssh-origin [email protected]:alexwlchan/alexwlchan.net.git
git push --verbose ssh-origin HEAD:master
condition: "eq(variables['Build.SourceBranch'], 'refs/heads/master')"
displayName: "Deploy to Linode and push new commits to GitHub"
env:
SSH_KEY: $(alex.sshKey)