Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions .github/workflows/push-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
name: push on dockerhub
on:
release:
types: [published]
push:
tags:
- '*'
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

[nitpick] Triggering on every tag ('*') may build unintended images; consider restricting to semantic version tags (e.g. v*.*.*).

Suggested change
- '*'
- 'v*.*.*'

Copilot uses AI. Check for mistakes.

jobs:
docker:
runs-on: ubuntu-20.04
runs-on: buildjet-2vcpu-ubuntu-2204
steps:
-
name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

[nitpick] When checking out submodules, adding fetch-depth: 0 ensures full history and proper submodule initialization.

Copilot uses AI. Check for mistakes.
with:
ref: ${{ github.ref }} # Use the reference to the release
-
name: Set up QEMU
ref: ${{ github.ref }}
submodules: recursive
- name: Setup Go Env
uses: actions/setup-go@v4
with:
go-version: "1.22"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub

- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: '${{ github.event.release.tag_name }}' # Use the release tag as the image tag
name: Build and push multi-arch image
env:
TAG: ${{ github.ref_name }}
IMAGE_TAG: ${{ github.ref_name }}
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

[nitpick] You define both TAG and IMAGE_TAG with the same value; consider using a single variable to reduce redundancy.

Suggested change
IMAGE_TAG: ${{ github.ref_name }}

Copilot uses AI. Check for mistakes.
run: |
echo "building multi-arch images with tag: $TAG"
make build-push-multi-arch-image
Comment on lines +35 to +40
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

[nitpick] Using a run block for Docker builds loses built-in caching and insights; consider using docker/build-push-action@v5 with build-push instead.

Suggested change
env:
TAG: ${{ github.ref_name }}
IMAGE_TAG: ${{ github.ref_name }}
run: |
echo "building multi-arch images with tag: $TAG"
make build-push-multi-arch-image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/my-image:${{ github.ref_name }}
platforms: linux/amd64,linux/arm64

Copilot uses AI. Check for mistakes.
Loading
Loading