-
Notifications
You must be signed in to change notification settings - Fork 2
fix(ci): release docker image #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,35 +1,40 @@ | ||||||||||||||||||||||||||
| name: push on dockerhub | ||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||
| types: [published] | ||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||
| - '*' | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| 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 }} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| IMAGE_TAG: ${{ github.ref_name }} |
Copilot
AI
Jun 4, 2025
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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*.*.*).