-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (44 loc) · 1.39 KB
/
deploy-azure-acr.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
name: Build and deploy a container to an Azure Container Registry
on:
push:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
env:
SQLFLUFF_DIALECT: postgres
DOCKER_IMAGE: redgate/flyway
SCHEMAS: public
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Apply migrations
run: >-
docker run --rm
--volume ${{ github.workspace }}/src/migrations:/flyway/sql:ro
--volume ${{ github.workspace }}/reports:/flyway/reports
"${{ env.DOCKER_IMAGE }}"
-url="${{ secrets.DB_PROD_URL }}"
-user="${{ secrets.DB_PROD_USERNAME }}"
-password="${{ secrets.DB_PROD_PASSWORD }}"
migrate -schemas="${{ env.SCHEMAS }}"
- name: Upload Flyway report
uses: actions/upload-artifact@v3
with:
name: Database Report
path: reports/
- name: 'Docker Login'
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build the frontend image and push it to ACR
uses: docker/build-push-action@v2
with:
push: true
tags: dotnetruacr.azurecr.io/vahter-bot-ban:${{ github.sha }}, dotnetruacr.azurecr.io/vahter-bot-ban:latest
file: ./Dockerfile