Skip to content

Add GitHub Actions workflow for Docker image build and push#2

Merged
Luo923 merged 2 commits intomainfrom
copilot/build-docker-image
Mar 8, 2026
Merged

Add GitHub Actions workflow for Docker image build and push#2
Luo923 merged 2 commits intomainfrom
copilot/build-docker-image

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 7, 2026

No automated pipeline existed to build and publish the Docker image defined in the repo's Dockerfile.

Changes

  • New workflow (.github/workflows/docker.yml): builds and pushes to ghcr.io/<owner>/<repo> on push to main, version tags (v*), or manual dispatch
  • Multi-platform: builds linux/amd64 and linux/arm64 via QEMU + Buildx
  • Tagging strategy: branch name, semver ({{version}}, {{major}}.{{minor}}), and short commit SHA via docker/metadata-action
  • Caching: GitHub Actions cache (type=gha) for faster layer reuse
  • Auth: uses built-in GITHUB_TOKEN with packages: write — no extra secrets required
- name: Build and push Docker image
  uses: docker/build-push-action@v6
  with:
    context: .
    platforms: linux/amd64,linux/arm64
    push: true
    tags: ${{ steps.meta.outputs.tags }}
    cache-from: type=gha
    cache-to: type=gha,mode=max

Pull the image after a successful run:

docker pull ghcr.io/luo923/cursor2api-go:main

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Luo923 <82445003+Luo923@users.noreply.github.com>
Copilot AI changed the title [WIP] Build Docker image for application Add GitHub Actions workflow for Docker image build and push Mar 7, 2026
@Luo923 Luo923 marked this pull request as ready for review March 8, 2026 01:47
Copilot AI review requested due to automatic review settings March 8, 2026 01:47
@Luo923 Luo923 merged commit deca77e into main Mar 8, 2026
3 of 5 checks passed
@Luo923 Luo923 deleted the copilot/build-docker-image branch March 8, 2026 01:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an automated GitHub Actions pipeline to build and publish the repository’s Docker image to GitHub Container Registry (GHCR), enabling repeatable multi-arch image releases without manual steps.

Changes:

  • Introduces a new workflow that builds and pushes images on pushes to main, version tags (v*), and manual dispatch.
  • Uses QEMU + Buildx to publish multi-platform images (linux/amd64, linux/arm64).
  • Implements consistent tagging/labeling via docker/metadata-action plus GitHub Actions cache for faster rebuilds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants