@@ -152,3 +152,50 @@ jobs:
152152 run : |
153153 VERSION=${{ needs.prepare.outputs.version }}
154154 gh release upload "v${VERSION}" "${{ steps.package.outputs.archive }}" --clobber
155+
156+ docker :
157+ needs : [prepare, publish]
158+ if : needs.prepare.outputs.publish == 'true'
159+ runs-on : ubuntu-latest
160+ permissions :
161+ contents : read
162+ packages : write
163+ steps :
164+ - name : Checkout
165+ uses : actions/checkout@v4
166+
167+ - name : Download release artifacts
168+ env :
169+ GH_TOKEN : ${{ github.token }}
170+ run : |
171+ set -euo pipefail
172+ VERSION=${{ needs.prepare.outputs.version }}
173+ mkdir -p artifacts/amd64 artifacts/arm64
174+ gh release download "v${VERSION}" \
175+ --pattern "databend-loki-adapter-${VERSION}-x86_64-unknown-linux-musl.tar.gz" \
176+ --dir artifacts/amd64
177+ gh release download "v${VERSION}" \
178+ --pattern "databend-loki-adapter-${VERSION}-aarch64-unknown-linux-musl.tar.gz" \
179+ --dir artifacts/arm64
180+ tar -xzf artifacts/amd64/*.tar.gz -C artifacts/amd64
181+ tar -xzf artifacts/arm64/*.tar.gz -C artifacts/arm64
182+
183+ - name : Set up Docker Buildx
184+ uses : docker/setup-buildx-action@v3
185+
186+ - name : Login to GHCR
187+ uses : docker/login-action@v3
188+ with :
189+ registry : ghcr.io
190+ username : ${{ github.actor }}
191+ password : ${{ github.token }}
192+
193+ - name : Build and push
194+ uses : docker/build-push-action@v6
195+ with :
196+ context : .
197+ platforms : linux/amd64,linux/arm64
198+ push : true
199+ tags : |
200+ ghcr.io/${{ github.repository }}:${{ needs.prepare.outputs.version }}
201+ ghcr.io/${{ github.repository }}:latest
0 commit comments