-
Notifications
You must be signed in to change notification settings - Fork 0
updated to deploy specific release tags for the docker images when we… #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated to deploy specific release tags for the docker images when we… #3
Conversation
… do docker stack deploy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances the deployment workflow to support versioned Docker image deployments with configurable backend and frontend tags. The changes enable more precise control over which versions of services are deployed while maintaining backward compatibility.
- Added configurable version inputs for backend and frontend Docker images
- Renamed
skip_buildtoskip_backend_buildfor improved clarity - Implemented dynamic tag substitution in docker-compose.yml based on workflow inputs
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/deploy-production.yml | Added version inputs, renamed skip_build parameter, and implemented dynamic tag setting logic |
| docker-compose.yml | Updated image tags to use environment variables instead of hardcoded 'latest' |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| sed -i "s/\${BACKEND_TAG}/$BACKEND_TAG/g" docker-compose.yml | ||
| sed -i "s/\${FRONTEND_TAG}/$FRONTEND_TAG/g" docker-compose.yml |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using sed with variable substitution without proper escaping can lead to command injection if the tag variables contain special characters. Consider using a more secure approach like envsubst or proper shell escaping.
| sed -i "s/\${BACKEND_TAG}/$BACKEND_TAG/g" docker-compose.yml | |
| sed -i "s/\${FRONTEND_TAG}/$FRONTEND_TAG/g" docker-compose.yml | |
| export BACKEND_TAG FRONTEND_TAG | |
| envsubst '${BACKEND_TAG},${FRONTEND_TAG}' < docker-compose.yml > docker-compose.yml.tmp | |
| mv docker-compose.yml.tmp docker-compose.yml |
| sed -i "s/\${BACKEND_TAG}/$BACKEND_TAG/g" docker-compose.yml | ||
| sed -i "s/\${FRONTEND_TAG}/$FRONTEND_TAG/g" docker-compose.yml |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using sed with variable substitution without proper escaping can lead to command injection if the tag variables contain special characters. Consider using a more secure approach like envsubst or proper shell escaping.
| sed -i "s/\${BACKEND_TAG}/$BACKEND_TAG/g" docker-compose.yml | |
| sed -i "s/\${FRONTEND_TAG}/$FRONTEND_TAG/g" docker-compose.yml | |
| export BACKEND_TAG FRONTEND_TAG | |
| envsubst '${BACKEND_TAG},${FRONTEND_TAG}' < docker-compose.yml > docker-compose.yml.subst | |
| mv docker-compose.yml.subst docker-compose.yml |
| run: | | ||
| # Backend tag | ||
| if [ "${{ github.event.inputs.skip_backend_build }}" == "true" ]; then | ||
| BACKEND_TAG="${{ github.event.inputs.backend_version || 'latest' }}" |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback to 'latest' may not work as expected when backend_version is an empty string rather than null. Consider using a more explicit check or defaulting in the workflow input definition.
| BACKEND_TAG="${{ github.event.inputs.backend_version || 'latest' }}" | |
| BACKEND_TAG="${{ github.event.inputs.backend_version != '' && github.event.inputs.backend_version || 'latest' }}" |
This pull request updates the deployment workflow and Docker Compose configuration to allow for more flexible versioning and deployment of backend and frontend services. The main improvements are the introduction of customizable version tags for both backend and frontend images, and the ability to skip backend builds during deployment.
Workflow and deployment improvements:
skip_buildtoskip_backend_buildfor clarity, and updated all related workflow logic to use the new name. [1] [2]frontend_versionandbackend_version, allowing users to specify which tags of the frontend and backend images to deploy. Defaults to'latest'if not provided.docker-compose.ymlbased on workflow inputs or the current Git reference.Configuration changes:
docker-compose.ymlto use theBACKEND_TAGandFRONTEND_TAGenvironment variables for the backend and frontend image tags, instead of hardcoding'latest'. [1] [2]… do docker stack deploy