-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.07 KB
/
main.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
name: Main
on:
push:
branches:
- main
env:
IMAGE_TAG: ${{ github.sha }}
REGISTRY_USERNAME: prereview
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- name: 'Checkout code'
uses: actions/checkout@v2
- name: 'Log in to Azure'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: 'Deploy app'
uses: azure/webapps-deploy@v2
with:
app-name: 'prereview2'
slot-name: 'staging'
images: prereview.azurecr.io/prereview:${{ env.IMAGE_TAG }}
configuration-file: './deploy/docker-compose.yml'
tag:
runs-on: ubuntu-20.04
needs: deploy
continue-on-error: true
steps:
- name: 'Tag as latest'
uses: tinact/docker.image-retag@1.0.3
with:
image_name: 'prereview'
image_old_tag: ${{ env.IMAGE_TAG }}
image_new_tag: 'latest'
registry: 'prereview.azurecr.io'
registry_username: ${{ env.REGISTRY_USERNAME }}
registry_password: ${{ secrets.REGISTRY_PASSWORD }}