ci: Refactor Docker workflow#966
Open
Vamshi-Microsoft wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors CI workflows around Docker build/deploy by moving the ACR test registry endpoint from GitHub secrets to GitHub variables (vars), simplifying how the reusable Docker build workflow is triggered, and tightening workflow permissions for OIDC usage.
Changes:
- Switched ACR endpoint references from
secrets.ACR_TEST_LOGIN_SERVERtovars.ACR_TEST_LOGIN_SERVERacross Docker build and deploy reusable workflows. - Simplified
job-docker-build.ymlby removingworkflow_callinputs, addingworkflow_dispatch, and defining explicitpermissions. - Updated
deploy-orchestrator.ymlto conditionally run the reusable docker build job without passing the removed inputs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/job-docker-build.yml | Adds workflow_dispatch + explicit permissions; switches ACR endpoint to vars; removes workflow_call inputs. |
| .github/workflows/job-deploy-windows.yml | Uses vars.ACR_TEST_LOGIN_SERVER for setting the AZD container registry endpoint during Windows deploy. |
| .github/workflows/job-deploy-linux.yml | Uses vars.ACR_TEST_LOGIN_SERVER for setting the AZD container registry endpoint during Linux deploy. |
| .github/workflows/deploy-orchestrator.yml | Stops passing removed inputs to the docker build reusable workflow; keeps orchestration conditional logic. |
Comments suppressed due to low confidence (1)
.github/workflows/job-docker-build.yml:95
- The Docker build summary script assigns
ACR_NAMEto the full login server (e.g.myacr.azurecr.io) and then later appends.azurecr.ioagain, which will produce incorrect image URLs in the step summary (e.g.myacr.azurecr.io.azurecr.io/...). The summary also reports the wrong image count and useskm-webeven though the workflow tags the WebApp image askm-app.
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
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request updates our GitHub Actions workflows to improve how we handle Azure Container Registry (ACR) configuration, primarily by switching from using GitHub secrets to using GitHub environment variables (
vars). It also refines the Docker build workflow triggers and permissions for better security and maintainability.Key changes include:
ACR Configuration Updates:
secrets.ACR_TEST_LOGIN_SERVERwithvars.ACR_TEST_LOGIN_SERVERin the Docker build and deploy workflows, ensuring that ACR endpoints are now sourced from environment variables instead of secrets. This change affects the Docker login step, image tagging, and deployment scripts in both Linux and Windows jobs. [1] [2] [3] [4] [5] [6]Workflow Triggers and Inputs:
trigger_type,build_docker_image) fromjob-docker-build.yml, and added aworkflow_dispatchtrigger. This simplifies how the workflow is triggered and removes unnecessary complexity.deploy-orchestrator.ymlworkflow to add a conditional check on thedocker-buildjob, now only running it when triggered manually and when building Docker images, aligning with the new trigger logic.Permissions:
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information