forked from rstropek/git-fundamentals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
56 lines (47 loc) · 1.16 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
49
50
51
52
53
54
55
56
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
persistCredentials: true
clean: true
displayName: 'Checkout'
- script: |
git config --global user.email "rainer@software-architects.at"
git config --global user.name "Rainer"
displayName: 'Git Settings'
- script: |
npm install
npm run build
rm package-lock.json
displayName: 'Build'
- task: CopyFiles@2
inputs:
sourceFolder: dist
targetFolder: $(Agent.TempDirectory)/dist
cleanTargetFolder: true
overWrite: true
displayName: 'Copy build result to temp'
- task: CopyFiles@2
inputs:
contents: .gitignore
targetFolder: $(Agent.TempDirectory)/dist
cleanTargetFolder: false
overWrite: true
displayName: 'Copy .gitignore to temp'
- script: |
git checkout gh-pages
displayName: 'Switch to gh-pages branch'
- task: CopyFiles@2
inputs:
sourceFolder: $(Agent.TempDirectory)/dist
targetFolder: .
overWrite: true
displayName: 'Copy build results to gh-pages branch'
- script: |
rm .gitignore
git add --all .
git commit -m 'Update website'
git push origin gh-pages
displayName: 'Git push gh-pages branch'