This repository was archived by the owner on Oct 9, 2023. It is now read-only.
forked from JingWangTW/dark-theme-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
66 lines (59 loc) · 2.23 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
trigger:
- azure
pool:
'Strubli Pool'
stages:
- stage: 'Prepare'
displayName: 'Prepare'
jobs:
- job: checkout
steps:
- checkout: self
submodules: true
persistCredentials: true
- job: 'Build'
pool:
'Strubli Pool'
steps:
- script: |
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" \
submodule update --init --recursive
displayName: Fetch Submodules
- script: |
sed -i -e "s/2023-01-01T00:00:00+0200/$(date '+%Y-%m-%dT%H:%M:%S%z')/g" hugo.yml
displayName: Insert BuildTimestamp in hugo.yml
- script: |
/home/linuxbrew/.linuxbrew/bin/hugo --enableGitInfo
displayName: 'build hugo site'
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/public'
includeRootFolder: false
archiveType: zip
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
verbose: true
- upload: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
artifact: drop
- stage: 'Deployment'
displayName: 'Deployment'
jobs:
- deployment: Wiki_Server
displayName: Deployment to Strubli wiki server
environment:
name: 'Wiki Server'
resourceName: 'wiki-server'
resourceType: virtualMachine
strategy:
runOnce:
deploy:
steps:
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
destinationFolder: '/var/www/html/$(WIKI-NAME)/'
cleanDestinationFolder: true
overwriteExistingFiles: false
- script: |
curl -H "Content-Type: application/json" -X POST -d '{ "content": "Deployment for $(WIKI-NAME) triggered.", "embeds": [ { "title": "Wiki page '$(WIKI-NAME)' ✅", "description": "Wiki page '$(WIKI-NAME)' successfully deployed. Build id: $(Build.BuildId) 🥳", "url": "https://dev.azure.com/strubli/Strubli%20Wiki/_build/results?buildId=$(Build.BuildId)" } ] }' https://discord.com/api/webhooks/1155459564880269382/q1MDl_diuZ0Pr8YrP_lVJf8m_lA3Cgp1ZHhlLwGqWausaOnPZ9oJS_2qi5JnHTgfi-S3