-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
69 lines (64 loc) · 2.13 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
trigger:
- master
pr:
- master
stages:
- stage: test
jobs:
- template: .azure/build-test.yml # Template reference
- stage: build
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
jobs:
- template: .azure/build-template.yml # Template reference
parameters:
name: linux
vmImage: 'ubuntu-latest'
artifact: linux
runtime: linux-x64
- template: .azure/build-template.yml # Template reference
parameters:
name: windows
vmImage: 'windows-latest'
artifact: windows
runtime: win-x64
- template: .azure/build-template.yml # Template reference
parameters:
name: macos
vmImage: 'macOS-latest'
artifact: macos
runtime: osx-x64
- stage: github
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
jobs:
- job: github_release
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
targetPath: '$(Pipeline.Workspace)'
- task: GitHubRelease@0
inputs:
gitHubConnection: 'github.com'
repositoryName: 'mattiascibien/image-search-bot'
tagSource: manual
tag: v$(Build.BuildNumber)
title: Release v$(Build.BuildNumber)
assets: '$(Pipeline.Workspace)/**/*.zip'
isDraft: false
addChangeLog: true
- stage: docker
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
jobs:
- job: dockerhub
continueOnError: false
steps:
- task: Docker@2
displayName: 'Login To DockerHub'
inputs:
containerRegistry: 'DockerHub'
command: 'login'
- bash: docker buildx create --bootstrap --driver docker-container --use --platform linux/amd64,linux/arm64
displayName: 'Create multi-arch Docker Builder'
- bash: docker buildx build --no-cache --push --platform linux/amd64,linux/arm64 -f Dockerfile --tag mattiascibien/image-search-bot:latest --tag mattiascibien/image-search-bot:$(Build.BuildNumber) .
displayName: 'Build and push Image'