forked from microsoft/jumpstart-agora-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (111 loc) · 4.6 KB
/
pos-app-initial-images-build.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Build-and-push-v1.0-images
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
build-and-deploy-v1-image:
if: ${{ github.repository != 'microsoft/jumpstart-agora-apps' }} && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
# checkout the repo
- name: 'Checkout repository'
uses: actions/checkout@v4
- name: 'Login to ACR'
uses: azure/docker-login@v1
with:
login-server: "${{ secrets.ACR_NAME }}.azurecr.io"
username: ${{ secrets.SPN_CLIENT_ID }}
password: ${{ secrets.SPN_CLIENT_SECRET }}
- name: 'Build and push pos v1.0 images'
env:
latest_tag: "v1.0"
uses: nick-fields/retry@v3
with:
timeout_minutes: 25
retry_on: error
max_attempts: 3
command: |
branches=("production" "staging" "canary" "main")
# Build pos image for each branch
for branch in "${branches[@]}"; do
if [ $branch == "main" ]; then
branch="dev"
fi
docker build ./contoso_supermarket/developer/pos/src -t "${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/pos:$latest_tag"
docker push ${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/pos:$latest_tag
done
- name: 'Build and push cloudSync v1.0 images'
env:
latest_tag: "v1.0"
uses: nick-fields/retry@v3
with:
timeout_minutes: 25
retry_on: error
max_attempts: 3
command: |
# Build cloudSync image for each branch
branches=("production" "staging" "canary" "main")
for branch in "${branches[@]}"; do
if [ $branch == "main" ]; then
branch="dev"
fi
docker build ./contoso_supermarket/developer/pos/src/cloud_sync -t "${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/pos-cloudsync:v1.0"
docker push ${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/pos-cloudsync:v1.0
done
- name: 'Build and push contosoAi v1.0 images'
env:
latest_tag: "v1.0"
uses: nick-fields/retry@v3
with:
timeout_minutes: 25
retry_on: error
max_attempts: 3
command: |
# Build contosoAi image for each branch
branches=("production" "staging" "canary" "main")
for branch in "${branches[@]}"; do
if [ $branch == "main" ]; then
branch="dev"
fi
docker build ./contoso_supermarket/developer/ai/src -t "${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/contosoai:v1.0"
docker push ${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/contosoai:v1.0
done
- name: 'Build and push queue monitoring backend v1.0 images'
env:
latest_tag: "v1.0"
uses: nick-fields/retry@v3
with:
timeout_minutes: 25
retry_on: error
max_attempts: 3
command: |
# Build queue monitoring backend image for each branch
branches=("production" "staging" "canary" "main")
for branch in "${branches[@]}"; do
if [ $branch == "main" ]; then
branch="dev"
fi
docker build ./contoso_supermarket/developer/queue_monitoring_backend/src -t "${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/queue-monitoring-backend:v1.0"
docker push ${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/queue-monitoring-backend:v1.0
done
- name: 'Build and push queue monitoring frontend v1.0 images'
env:
latest_tag: "v1.0"
uses: nick-fields/retry@v3
with:
timeout_minutes: 25
retry_on: error
max_attempts: 3
command: |
# Build queue monitoring frontend image for each branch
branches=("production" "staging" "canary" "main")
for branch in "${branches[@]}"; do
if [ $branch == "main" ]; then
branch="dev"
fi
docker build ./contoso_supermarket/developer/queue_monitoring_frontend/src -t "${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/queue-monitoring-frontend:v1.0"
docker push ${{ secrets.ACR_NAME }}.azurecr.io/$branch/contoso-supermarket/queue-monitoring-frontend:v1.0
done