-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.34 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
49
50
51
52
name: Build and Push to ACR
on:
push:
branches:
- "main"
permissions:
id-token: write
contents: read
jobs:
build:
name: "Build and Push to ACR"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ secrets.AZURE_URL }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Build and Push to ACR
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ secrets.AZURE_URL }}/incstats:${{ github.sha }}
file: Dockerfile
build-args: |
DATABASE_URL=your_database_url
- name: Redeploy Azure Container App
run: |
az containerapp revision copy \
--name sbu-inslack-nea-app \
--resource-group sbu-public-incstats-net-nea-rg \
--cpu 0.5 \
--memory 1.0 \
--image ${{ secrets.AZURE_URL }}/incstats:${{ github.sha }}