Skip to content

Commit 096cf7a

Browse files
committed
add docker hub build
1 parent 0630555 commit 096cf7a

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/release.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,33 @@ jobs:
143143
with:
144144
draft: false
145145
files: ${{ steps.package.outputs.archive }}
146-
prerelease: ${{ steps.check-tag.outputs.rc == 'true' }}
146+
prerelease: ${{ steps.check-tag.outputs.rc == 'true' }}
147+
docker:
148+
name: Publish to Docker Hub
149+
if: startsWith(github.ref, 'refs/tags/')
150+
runs-on: ubuntu-latest
151+
needs: release
152+
steps:
153+
- name: Set up QEMU
154+
uses: docker/setup-qemu-action@v3
155+
- name: Set up Docker Buildx
156+
uses: docker/setup-buildx-action@v3
157+
- name: Login to DockerHub
158+
uses: docker/login-action@v3
159+
with:
160+
username: ${{ github.repository_owner }}
161+
password: ${{ secrets.DOCKERHUB_TOKEN }}
162+
- name: Build and push
163+
uses: docker/build-push-action@v5
164+
with:
165+
file: Dockerfile-release
166+
build-args: |
167+
REPO=${{ github.repository }}
168+
VER=${{ github.ref_name }}
169+
platforms: |
170+
linux/amd64
171+
linux/arm64
172+
linux/386
173+
linux/arm/v7
174+
push: ${{ needs.release.outputs.rc == 'false' }}
175+
tags: ${{ github.repository }}:latest, ${{ github.repository }}:${{ github.ref_name }}

0 commit comments

Comments
 (0)