Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/deploy-orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ env:

jobs:
docker-build:
if: inputs.trigger_type == 'workflow_dispatch' && inputs.build_docker_image == true
Comment thread
Vamshi-Microsoft marked this conversation as resolved.
uses: ./.github/workflows/job-docker-build.yml
with:
trigger_type: ${{ inputs.trigger_type }}
build_docker_image: ${{ inputs.build_docker_image }}
secrets: inherit

deploy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job-deploy-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ jobs:
# Set ACR name only when building Docker image
if [[ "$BUILD_DOCKER_IMAGE" == "true" ]]; then
# Extract ACR name from login server and set as environment variable
ACR_NAME=$(echo "${{ secrets.ACR_TEST_LOGIN_SERVER }}")
ACR_NAME=$(echo "${{ vars.ACR_TEST_LOGIN_SERVER }}")
azd env set AZURE_ENV_CONTAINER_REGISTRY_ENDPOINT="$ACR_NAME"
echo "Set ACR host to: $ACR_NAME"
Comment thread
Roopan-Microsoft marked this conversation as resolved.
else
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job-deploy-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ jobs:

# Set ACR name only when building Docker image
if ($env:BUILD_DOCKER_IMAGE -eq "true") {
$ACR_NAME = "${{ secrets.ACR_TEST_LOGIN_SERVER }}"
$ACR_NAME = "${{ vars.ACR_TEST_LOGIN_SERVER }}"
azd env set AZURE_ENV_CONTAINER_REGISTRY_ENDPOINT="$ACR_NAME"
Write-Host "Set ACR host to: $ACR_NAME"
Comment thread
Vamshi-Microsoft marked this conversation as resolved.
} else {
Expand Down
38 changes: 18 additions & 20 deletions .github/workflows/job-docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
name: Docker Build Job
name: Build & Push Test Images (Feature Branch)

on:
workflow_call:
inputs:
trigger_type:
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
required: true
type: string
build_docker_image:
description: 'Build And Push Docker Image (Optional)'
required: false
default: false
type: boolean
outputs:
IMAGE_TAG:
description: "Generated Docker Image Tag"
value: ${{ jobs.docker-build.outputs.IMAGE_TAG }}
workflow_dispatch:

permissions:
contents: read
id-token: write

env:
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }}

jobs:
docker-build:
if: inputs.trigger_type == 'workflow_dispatch' && inputs.build_docker_image == true
runs-on: ubuntu-latest
environment: production
outputs:
Expand Down Expand Up @@ -56,7 +50,11 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Log in to Azure Container Registry
run: az acr login --name ${{ secrets.ACR_TEST_LOGIN_SERVER }}
shell: bash
run: |
# Extract registry name from login server (e.g., myacr.azurecr.io -> myacr)
ACR_NAME=$(echo "${{ vars.ACR_TEST_LOGIN_SERVER }}" | cut -d'.' -f1)
az acr login --name "$ACR_NAME"
Comment thread
Vamshi-Microsoft marked this conversation as resolved.

- name: Build and Push Backend API Docker Image
id: build_push_image
Expand All @@ -69,8 +67,8 @@ jobs:
push: true
provenance: false
tags: |
${{ secrets.ACR_TEST_LOGIN_SERVER }}/backend-api:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}
${{ secrets.ACR_TEST_LOGIN_SERVER }}/backend-api:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}_${{ github.run_number }}
${{ vars.ACR_TEST_LOGIN_SERVER }}/backend-api:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}
${{ vars.ACR_TEST_LOGIN_SERVER }}/backend-api:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}_${{ github.run_number }}

- name: Build and Push Processor Docker Image
uses: docker/build-push-action@v7
Expand All @@ -82,8 +80,8 @@ jobs:
push: true
provenance: false
tags: |
${{ secrets.ACR_TEST_LOGIN_SERVER }}/processor:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}
${{ secrets.ACR_TEST_LOGIN_SERVER }}/processor:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}_${{ github.run_number }}
${{ vars.ACR_TEST_LOGIN_SERVER }}/processor:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}
${{ vars.ACR_TEST_LOGIN_SERVER }}/processor:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}_${{ github.run_number }}

- name: Build and Push Front End Docker Image
uses: docker/build-push-action@v7
Expand All @@ -95,8 +93,8 @@ jobs:
push: true
provenance: false
tags: |
${{ secrets.ACR_TEST_LOGIN_SERVER }}/frontend:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}
${{ secrets.ACR_TEST_LOGIN_SERVER }}/frontend:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}_${{ github.run_number }}
${{ vars.ACR_TEST_LOGIN_SERVER }}/frontend:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}
${{ vars.ACR_TEST_LOGIN_SERVER }}/frontend:${{ steps.generate_docker_tag.outputs.IMAGE_TAG }}_${{ github.run_number }}

- name: Verify Docker Image Build
shell: bash
Expand All @@ -108,7 +106,7 @@ jobs:
if: always()
shell: bash
run: |
ACR_NAME=$(echo "${{ secrets.ACR_TEST_LOGIN_SERVER }}")
ACR_NAME=$(echo "${{ vars.ACR_TEST_LOGIN_SERVER }}")
echo "## 🐳 Docker Build Job Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
Expand Down
Loading