Skip to content

Migrate container publishing from Docker Hub to GHCR with automatic versioning#21

Open
Copilot wants to merge 3 commits intomainfrom
copilot/push-to-ghcr
Open

Migrate container publishing from Docker Hub to GHCR with automatic versioning#21
Copilot wants to merge 3 commits intomainfrom
copilot/push-to-ghcr

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Description

Migrates container image publishing from Docker Hub to GitHub Container Registry (GHCR) and implements automatic versioning on merge to main.

Key Changes:

  • Release workflow (release.yml): Replaced Docker Hub authentication with GHCR using built-in GITHUB_TOKEN. Updated all image tags to ghcr.io/matthadfield113/smart-energy-controller. No repository secrets required.

  • Auto-version workflow (auto-version.yml): New workflow that auto-increments patch version in config.json on push to main, commits the change, creates a git tag, and triggers the release workflow. Skippable via [skip-version] commit message. Ignores markdown, workflow, and test-only changes.

  • Documentation: Updated CI/CD docs to reflect GHCR usage and automatic versioning behavior.

Workflow:

Push to main → Auto-increment version (1.2.0 → 1.2.1) → Commit + Tag → Release → GHCR

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition/update

Related Issue

Fixes #20

Testing

Test Configuration

  • Workflows: GitHub Actions
  • Python Version: 3.11
  • YAML validation: Passed

Test Steps

  1. Validated YAML syntax for both workflow files
  2. Tested version increment logic (1.2.0 → 1.2.1)
  3. Verified no Docker Hub references remain in workflows
  4. Confirmed GHCR authentication uses GITHUB_TOKEN
  5. Validated workflow permissions (contents: write, packages: write)
  6. Ran CodeQL security scan (0 alerts)

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have updated the CHANGELOG.md

Screenshots (if applicable)

N/A - Workflow configuration changes only

Additional Notes

  • No DOCKER_USERNAME or DOCKER_PASSWORD secrets needed - uses built-in GITHUB_TOKEN
  • Auto-versioning only triggers on code changes (ignores docs/workflows/tests)
  • To skip versioning: include [skip-version] in commit message
  • Images will be available at: ghcr.io/matthadfield113/smart-energy-controller:v{version}-{arch}
Original prompt

This section details on the original issue you should resolve

<issue_title>Push to GHCR instead of Docker Hub</issue_title>
<issue_description>Push the containers to GHCR instead of docker hub.

We should also change the version every time some new code is merged to main and make a new release.</issue_description>

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


💡 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.

Co-authored-by: MattHadfield113 <30897252+MattHadfield113@users.noreply.github.com>
@MattHadfield113 MattHadfield113 marked this pull request as ready for review November 7, 2025 22:24
Co-authored-by: MattHadfield113 <30897252+MattHadfield113@users.noreply.github.com>
Copilot AI changed the title [WIP] Push containers to GHCR instead of Docker Hub Migrate container publishing from Docker Hub to GHCR with automatic versioning Nov 7, 2025
Copilot AI requested a review from MattHadfield113 November 7, 2025 22:30
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.

Push to GHCR instead of Docker Hub

2 participants