-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
48 lines (45 loc) · 1.47 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
# Reference: https://aka.ms/yaml
# Things to note:
# - Powershell session profiles do not work because the scripts are run with -NoProfile
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
steps:
- script: sudo npm install -g markdown-styles
displayName: Install tools
- script: make
displayName: Build help pages
- task: DownloadSecureFile@1
inputs:
secureFile: deploy_key
displayName: 'Get the deploy key'
- script: |
mkdir ~/.ssh && mv $DOWNLOADSECUREFILE_SECUREFILEPATH ~/.ssh/id_rsa
chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git remote set-url --push origin [email protected]:ztl8702/adfd.git
displayName: 'Setup deploy key'
condition: |
and(not(eq(variables['Build.Reason'], 'PullRequest')),
eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- script: |
cp -rf ./build /tmp/
git remote update
git fetch
git checkout gh-pages
git checkout -b gh-pages-new
git reset --hard origin/gh-pages
git rm -r '*'
rm -rf ./*
cp -rf /tmp/build/* ./
git add .
git config --local user.name "Azure Pipelines"
git config --local user.email "[email protected]"
git commit --message "Azure DevOps Build ***NO_CI***"
git checkout gh-pages
git reset --hard gh-pages-new --
git push --force origin gh-pages
condition: |
and(not(eq(variables['Build.Reason'], 'PullRequest')),
eq(variables['Build.SourceBranch'], 'refs/heads/master'))