-
Notifications
You must be signed in to change notification settings - Fork 123
42 lines (40 loc) · 1.18 KB
/
az-test.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
name: Build service images
on:
push:
branches:
- dev
- main
pull_request:
branches:
- dev
- main
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
build-and-push:
runs-on: ubuntu-latest
environment: build
strategy:
matrix:
include:
- dockerfile: Dockerfile-api_orchestrator
image-name: terravibes-api-orchestrator
- dockerfile: Dockerfile-worker
image-name: terravibes-worker
- dockerfile: Dockerfile-cache
image-name: terravibes-cache
steps:
- uses: actions/checkout@v4
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Build and push image'
run: |
az acr login -n ${{ secrets.ACR_NAME }}
docker build . -f ./resources/docker/${{ matrix.dockerfile }} -t ${{ secrets.ACR_NAME }}.azurecr.io/${{ matrix.image-name }}:test
docker push ${{ secrets.ACR_NAME }}.azurecr.io/${{ matrix.image-name }}:test