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
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target/
.git/
.github/
.env
*.md
LICENSE
Makefile
scripts/
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,50 @@ jobs:
run: |
VERSION=${{ needs.prepare.outputs.version }}
gh release upload "v${VERSION}" "${{ steps.package.outputs.archive }}" --clobber

docker:
needs: [prepare, publish]
if: needs.prepare.outputs.publish == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download release artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
VERSION=${{ needs.prepare.outputs.version }}
mkdir -p artifacts/amd64 artifacts/arm64
gh release download "v${VERSION}" \
--pattern "databend-loki-adapter-${VERSION}-x86_64-unknown-linux-musl.tar.gz" \
--dir artifacts/amd64
gh release download "v${VERSION}" \
--pattern "databend-loki-adapter-${VERSION}-aarch64-unknown-linux-musl.tar.gz" \
--dir artifacts/arm64
tar -xzf artifacts/amd64/*.tar.gz -C artifacts/amd64
tar -xzf artifacts/arm64/*.tar.gz -C artifacts/arm64

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

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ needs.prepare.outputs.version }}
ghcr.io/${{ github.repository }}:latest
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
ARG TARGETARCH
COPY artifacts/${TARGETARCH}/databend-loki-adapter /databend-loki-adapter
ENTRYPOINT ["/databend-loki-adapter"]
Loading