-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
51 lines (47 loc) · 1.09 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
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
branches:
include:
- master
- main
exclude:
- develop
- staging
paths:
exclude:
- README.md
# no PR triggers
pr: none
variables:
tag: 'latest'
jobs:
- job: BuildAndPublish
displayName: Build and publish Docker image
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
lfs: true
- task: Docker@2
displayName: Build an image
inputs:
containerRegistry: 'Dockerhub'
repository: 'artsdatabanken/nin-kode-api'
command: 'build'
Dockerfile: '**/Dockerfile'
tags: '$(tag)'
- task: Docker@2
displayName: Publish image
inputs:
containerRegistry: 'Dockerhub'
repository: 'artsdatabanken/nin-kode-api'
command: 'push'
tags: '$(tag)'
- task: AzureCLI@2
inputs:
azureSubscription: 'prod-deploy-code'
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: 'az webapp restart --name adb-prod-ninkapi-as --resource-group adb-prod-ninkapi-rg'