-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
77 lines (69 loc) · 2.06 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
74
75
76
77
trigger:
branches:
include:
- main
paths:
exclude:
- src/_drafts
- README.md
jobs:
- job: build
pool:
vmImage: 'ubuntu-20.04'
steps:
- task: UseRubyVersion@0
inputs:
versionSpec: '>= 2.7'
- script: |
gem install jekyll bundler
displayName: 'install jekyll'
- script: |
bundle install
bundle exec jekyll build
displayName: 'jekyll build'
- task: CopyFiles@2
displayName: 'Copy files to staging'
inputs:
SourceFolder: '_site'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish build artifact'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: site
- job: deploy
pool:
vmImage: 'ubuntu-20.04'
dependsOn: build
condition: succeeded()
steps:
# download the artifact drop from the previous job
- task: DownloadBuildArtifacts@0
inputs:
artifactName: site
downloadPath: '$(System.ArtifactsDirectory)'
# Copy files to Azure Blob Storage
- task: AzureCLI@2
displayName: Copy data to storage account
inputs:
azureSubscription: arm-service-connection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
az storage blob upload-batch \
--destination \$web \
--account-name "strbgvchah" \
--source "$(System.ArtifactsDirectory)/site"
# Purge CDN to update content
- task: AzureCLI@2
displayName: Purge CDN contents
inputs:
azureSubscription: arm-service-connection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
az cdn endpoint purge \
--name rbgv-cdn-chah-avh \
--profile-name cdn-chah \
--resource-group SC-CHAH \
--content-paths '/*'