Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 5, 2025

Overview

This PR adds a GitHub Actions CI workflow that automatically builds and releases container images to GitHub Container Registry (ghcr.io) as requested in the issue.

Changes

GitHub Actions CI Workflow (.github/workflows/ci.yml)

Created a comprehensive CI/CD pipeline with two jobs:

1. Build and Test Job

  • Runs on all pushes and pull requests
  • Sets up Go 1.24 environment
  • Downloads dependencies and builds the application
  • Executes tests to ensure code quality

2. Build and Push Image Job

  • Runs only on push events (skips pull requests)
  • Authenticates with GitHub Container Registry using GITHUB_TOKEN
  • Builds Docker image using the existing Dockerfile
  • Automatically tags and pushes images with intelligent tagging strategy:
    • Branch-based tags (e.g., main, main-<sha>)
    • Semantic version tags for releases (e.g., v1.0.0, 1.0, 1)

Documentation Updates

Updated README.md with a new section explaining:

  • How the automated CI/CD process works
  • Trigger conditions for image releases
  • Image tagging rules
  • Usage examples for pulling released images

Other Improvements

  • Updated .gitignore to exclude build artifacts (api binary)

Usage

After this PR is merged, container images will be automatically published to ghcr.io on every push to main or when version tags are created:

# Pull latest main version
docker pull ghcr.io/gthulhu/api:main

# Pull specific version
docker pull ghcr.io/gthulhu/api:v1.0.0

Testing

  • Verified Go application builds successfully
  • Validated GitHub Actions workflow syntax
  • Confirmed .gitignore excludes build artifacts

Fixes the issue by implementing automated container image release in the CI workflow.

Original prompt

This section details on the original issue you should resolve

<issue_title>Release container image on GitHub package</issue_title>
<issue_description>As title, add image release step in ci workflow.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #2

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits October 5, 2025 17:33
… packages

Co-authored-by: ianchen0119 <42661015+ianchen0119@users.noreply.github.com>
Co-authored-by: ianchen0119 <42661015+ianchen0119@users.noreply.github.com>
Copilot AI changed the title [WIP] Release container image on GitHub package Add CI workflow for automated container image release to GitHub Container Registry Oct 5, 2025
Copilot AI requested a review from ianchen0119 October 5, 2025 17:35
@ianchen0119 ianchen0119 marked this pull request as ready for review October 5, 2025 18:02
@ianchen0119 ianchen0119 merged commit 9e67ac8 into main Oct 5, 2025
4 checks passed
@ianchen0119 ianchen0119 deleted the copilot/fix-387f4c5f-449b-4a6d-a31c-f0b3417ace6c branch October 5, 2025 18:11
ianchen0119 pushed a commit that referenced this pull request Dec 28, 2025
account/rbac: implement role and auth handlers, and add handler integration test
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.

Release container image on GitHub package

2 participants