-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
73 lines (60 loc) · 1.74 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
hugo_version: '0.62.2'
target_branch: 'gh-pages'
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: |
wget https://github.com/gohugoio/hugo/releases/download/v$(hugo_version)/hugo_$(hugo_version)_Linux-64bit.deb \
-O '$(Pipeline.Workspace)/hugo_$(hugo_version)_Linux-64bit.deb'
sudo dpkg -i $(Pipeline.Workspace)/hugo*.deb
displayName: 'Install Hugo'
- script: |
curl https://sessionize.com/api/v2/pt2tdmzs/view/All > $(Build.SourcesDirectory)/data/sessionize.json
displayName: 'Download sessionize data'
- script: |
rm ./static/ics/*.ics
node ./utils/generate-ics.js
displayName: 'Generate ICS files'
- script: |
hugo
displayName: 'Build'
- task: CopyFiles@2
inputs:
sourceFolder: public
targetFolder: $(Agent.TempDirectory)/public
cleanTargetFolder: true
overWrite: true
displayName: 'Copy build result to temp'
- script: |
git reset --hard
git checkout $(target_branch)
rm -rf *
displayName: 'Switch to $(target_branch) branch'
- task: CopyFiles@2
inputs:
sourceFolder: $(Agent.TempDirectory)/public
targetFolder: .
overWrite: true
displayName: 'Copy build results to $(target_branch) branch'
- script: |
echo -e www.globalazurebootcamp.at'\n' > CNAME
displayName: 'Create CNAME file for GitHub Pages'
- script: |
ls -la
git status
cat .gitignore
git add --all .
git commit -m 'Update website'
git push origin $(target_branch)
displayName: 'Git push $(target_branch) branch'