Skip to content

Commit 2c52eca

Browse files
pipeline error for tag not found has been fixed
1 parent 250e6fd commit 2c52eca

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ jobs:
4242
- name: Get current date
4343
id: date
4444
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
45+
46+
- name: Get registry
47+
id: registry
48+
run: |
49+
echo "ext_registry=${{ secrets.ACR_LOGIN_SERVER || 'acrlogin.azurecr.io'}}" >> $GITHUB_OUTPUT
4550
4651
- name: Determine Tag Name Based on Branch
4752
id: determine_tag
@@ -64,6 +69,8 @@ jobs:
6469
RUN_ID=${{ github.run_number }}
6570
# Create historical tag using TAG, DATE_TAG, and RUN_ID
6671
echo "HISTORICAL_TAG=${{ env.TAG }}_${DATE_TAG}_${RUN_ID}" >> $GITHUB_ENV
72+
73+
6774

6875
- name: Build and optionally push Backend Docker image
6976
uses: docker/build-push-action@v6
@@ -72,8 +79,8 @@ jobs:
7279
file: ./src/backend/Dockerfile
7380
push: ${{ env.TAG != 'pullrequest-ignore' }}
7481
tags: |
75-
${{ secrets.ACR_LOGIN_SERVER }}/macaebackend:${{ env.TAG }}
76-
${{ secrets.ACR_LOGIN_SERVER }}/macaebackend:${{ env.HISTORICAL_TAG }}
82+
${{ steps.registry.outputs.ext_registry }}/macaebackend:${{ env.TAG }}
83+
${{ steps.registry.outputs.ext_registry }}/macaebackend:${{ env.HISTORICAL_TAG }}
7784
7885
- name: Build and optionally push Frontend Docker image
7986
uses: docker/build-push-action@v6
@@ -82,5 +89,5 @@ jobs:
8289
file: ./src/frontend/Dockerfile
8390
push: ${{ env.TAG != 'pullrequest-ignore' }}
8491
tags: |
85-
${{ secrets.ACR_LOGIN_SERVER }}/macaefrontend:${{ env.TAG }}
86-
${{ secrets.ACR_LOGIN_SERVER }}/macaefrontend:${{ env.HISTORICAL_TAG }}
92+
${{ steps.registry.outputs.ext_registry }}/macaefrontend:${{ env.TAG }}
93+
${{ steps.registry.outputs.ext_registry }}/macaefrontend:${{ env.HISTORICAL_TAG }}

0 commit comments

Comments
 (0)