Skip to content

Commit b390adc

Browse files
Updated the workflow for build and push docker
1 parent e532601 commit b390adc

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,12 @@ jobs:
3232
uses: docker/setup-buildx-action@v1
3333

3434
- name: Log in to Azure Container Registry
35-
if: ${{ github.ref_name == 'main' }}
3635
uses: azure/docker-login@v2
3736
with:
3837
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
3938
username: ${{ secrets.ACR_USERNAME }}
4039
password: ${{ secrets.ACR_PASSWORD }}
4140

42-
- name: Log in to Azure Container Registry (Dev/Demo)
43-
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
44-
uses: azure/docker-login@v2
45-
with:
46-
login-server: ${{ secrets.ACR_DEV_LOGIN_SERVER }}
47-
username: ${{ secrets.ACR_DEV_USERNAME }}
48-
password: ${{ secrets.ACR_DEV_PASSWORD }}
49-
5041
- name: Set Docker image tag
5142
run: |
5243
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
@@ -59,7 +50,6 @@ jobs:
5950
echo "TAG=hotfix" >> $GITHUB_ENV
6051
fi
6152
- name: Build and push Docker images
62-
if: ${{ github.ref_name == 'main' }}
6353
run: |
6454
cd src/backend
6555
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
@@ -69,15 +59,4 @@ jobs:
6959
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
7060
docker push ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
7161
echo "Frontend image built and pushed successfully."
72-
- name: Build and push Docker images (Dev/Demo/hotfix)
73-
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
74-
run: |
75-
cd src/backend
76-
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
77-
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} && \
78-
echo "Dev/Demo/Hotfix Backend image built and pushed successfully."
79-
cd ../frontend
80-
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
81-
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
82-
echo "Dev/Demo/Hotfix Frontend image built and pushed successfully."
8362

0 commit comments

Comments
 (0)