Skip to content

Commit 7791bd8

Browse files
author
Harmanpreet Kaur
committed
updated docker
1 parent d6afd6f commit 7791bd8

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/docker-build-and-push.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ on:
66
- main
77
- dev
88
- demo
9+
- hotfix
910
pull_request:
10-
types: [closed]
11+
types:
12+
- opened
13+
- ready_for_review
14+
- reopened
15+
- synchronize
1116
branches:
1217
- main
1318
- dev
1419
- demo
20+
- hotfix
1521
workflow_dispatch:
1622

1723
jobs:
@@ -34,7 +40,7 @@ jobs:
3440
password: ${{ secrets.ACR_PASSWORD }}
3541

3642
- name: Log in to Azure Container Registry (Dev/Demo)
37-
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' }}
43+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
3844
uses: azure/docker-login@v2
3945
with:
4046
login-server: ${{ secrets.ACR_DEV_LOGIN_SERVER }}
@@ -49,6 +55,8 @@ jobs:
4955
echo "TAG=dev" >> $GITHUB_ENV
5056
elif [[ "${{ github.ref }}" == "refs/heads/demo" ]]; then
5157
echo "TAG=demo" >> $GITHUB_ENV
58+
elif [[ "${{ github.ref }}" == "refs/heads/hotfix" ]]; then
59+
echo "TAG=hotfix" >> $GITHUB_ENV
5260
fi
5361
- name: Build and push Docker images
5462
if: ${{ github.ref_name == 'main' }}
@@ -61,15 +69,15 @@ jobs:
6169
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
6270
docker push ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
6371
echo "Frontend image built and pushed successfully."
64-
- name: Build and push Docker images (Dev/Demo)
65-
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' }}
72+
- name: Build and push Docker images (Dev/Demo/hotfix)
73+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
6674
run: |
6775
cd src/backend
6876
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
6977
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} && \
70-
echo "Dev/Demo Backend image built and pushed successfully."
78+
echo "Dev/Demo/Hotfix Backend image built and pushed successfully."
7179
cd ../frontend
7280
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
7381
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
74-
echo "Dev/Demo Frontend image built and pushed successfully."
82+
echo "Dev/Demo/Hotfix Frontend image built and pushed successfully."
7583

0 commit comments

Comments
 (0)