-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
53 lines (49 loc) · 1.41 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
pool:
vmImage: 'windows-2022'
variables:
- group: 'github-config'
stages:
- stage: Pack
jobs:
- job:
steps:
- checkout: self
persistCredentials: true
- task: ArchiveFiles@2
displayName: 'Create Zip archive'
inputs:
rootFolderOrFile: 'src'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/CodeListHub.Explorer.zip'
replaceExistingArchive: true
- task: CopyFiles@2
displayName: 'Copy Maintenance Page'
inputs:
Contents: 'nginx-maintenance.html'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
OverWrite: true
- task: PublishBuildArtifacts@1
displayName: 'Publish build artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- stage: GitHub
jobs:
- job:
steps:
- checkout: self
persistCredentials: true
- task: PowerShell@2
displayName: 'Push to GitHub'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
targetType: 'inline'
script: |
git remote add github https://$(PAT)@github.com/openpotato/codelisthub.explorer.git
git fetch github
git checkout .
git push github HEAD:main
git push --tags github HEAD:main
pwsh: true