diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5f9b2f6..fbc5fcc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,6 +35,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} GITHUB_HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }} + dockerhub: runs-on: ubuntu-latest needs: goreleaser @@ -47,13 +48,35 @@ jobs: with: go-version: 1.18 cache: true + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push Docker image - shell: bash + + - name: Get build info + id: build_info run: | - bash build_image.sh - docker push milvusdb/milvus-backup:$(git describe --tags --always) - docker push milvusdb/milvus-backup:latest + echo "VERSION=$(git describe --tags --always)" >> $GITHUB_OUTPUT + echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "DATE=$(date +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + milvusdb/milvus-backup:${{ steps.build_info.outputs.VERSION }} + milvusdb/milvus-backup:latest + build-args: | + VERSION=${{ steps.build_info.outputs.VERSION }} + COMMIT=${{ steps.build_info.outputs.COMMIT }} + DATE=${{ steps.build_info.outputs.DATE }}