Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 13, 2025

This PR implements automatic Docker image building and versioning when release tags are created, addressing the need for versioned Docker images that correspond to project releases.

Changes Made

Docker Workflows Enhanced

Updated all three Docker workflows (docker-api.yml, docker-admin.yml, docker-customer.yml) to:

  • Add release: types: [published] triggers alongside existing master branch triggers
  • Implement conditional logic to handle both development and release builds
  • Build and tag images with version numbers extracted from release tags

Versioning Strategy

When a release is published (e.g., v1.2.3), the workflows now:

  • Build Docker images tagged with the specific version: tolfixorg/cpg-api:v1.2.3
  • Also tag the same image as latest: tolfixorg/cpg-api:latest
  • Push both tags to DockerHub

Backwards Compatibility

Development workflow remains unchanged:

  • Master branch pushes continue to build images with build-{run_number} tags
  • No disruption to existing development processes

Documentation Updates

Updated the API README to:

  • Correct the Docker image name from tolfixorg/cpg:latest to tolfixorg/cpg-api:latest
  • Document the availability of versioned tags

Example Usage

After this change, users can pull specific versions:

# Pull a specific release version
docker pull tolfixorg/cpg-api:v1.2.1
docker pull tolfixorg/cpg-admin:v1.2.1
docker pull tolfixorg/cpg-customer:v1.2.1

# Pull the latest stable release
docker pull tolfixorg/cpg-api:latest

Technical Implementation

  • Uses GitHub's GITHUB_REF environment variable to extract tag names
  • Optimized Docker builds with multiple tags to avoid rebuilding the same image
  • All YAML syntax validated for correctness

This enhancement enables users to deploy specific versions of CPG applications using Docker, improving deployment stability and version management.

Fixes #60.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI assigned Copilot and Tolfx Aug 13, 2025
Copy link
Author

Copilot AI commented Aug 13, 2025

@Tolfx 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@Copilot Copilot AI changed the title [WIP] Docker images versions on release tags Add Docker image versioning for release tags Aug 13, 2025
@Copilot Copilot AI requested a review from Tolfx August 13, 2025 19:02
Copilot finished work on behalf of Tolfx August 13, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker images versions on release tags

2 participants