Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: build debian-based action image (#16098)

p0ny33955fc84634
diff --git a/.github/workflows/build-push-action-image.yml b/.github/workflows/build-push-action-image.yml
index 84bccebfa6..8a28e0971f 100644
--- a/.github/workflows/build-push-action-image.yml
+++ b/.github/workflows/build-push-action-image.yml
@@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true
jobs:
- docker:
+ build-alpine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -40,3 +40,32 @@ jobs:
bytebase/bytebase-action:${{ env.IMAGE_TAG }}
build-args: |
GIT_COMMIT=${{ env.GIT_COMMIT }}
+ build-debian:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Extract build args
+ id: extract_build_args
+ run: |
+ if [[ "${{ github.ref_name }}" =~ ^release/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ VERSION=$(echo "${{ github.ref_name }}" | sed 's/release\///')
+ else
+ VERSION="latest"
+ fi
+ echo "IMAGE_TAG=${VERSION}" >> $GITHUB_ENV
+ echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
+ - name: Login to DockerHub
+ uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v6
+ with:
+ context: .
+ file: scripts/Dockerfile.action-debian
+ push: true
+ tags: |
+ bytebase/bytebase-action:${{ env.IMAGE_TAG }}-debian
+ build-args: |
+ GIT_COMMIT=${{ env.GIT_COMMIT }}
\ No newline at end of file
diff --git a/scripts/Dockerfile.action-debian b/scripts/Dockerfile.action-debian
new file mode 100644
index 0000000000..2637309c2e
--- /dev/null
+++ b/scripts/Dockerfile.action-debian
@@ -0,0 +1,15 @@
+FROM golang:1.24.2-bookworm AS builder
+ARG GIT_COMMIT
+WORKDIR /action-build
+COPY action/ action/
+COPY . .
+RUN go build \
+--ldflags="-X 'github.com/bytebase/bytebase/action/args.Gitcommit=${GIT_COMMIT}'" \
+-o bytebase-action action/*.go
+
+FROM debian:bookworm-slim
+RUN apt-get update && apt-get install -y jq
+WORKDIR /
+COPY --from=builder /action-build/bytebase-action /usr/local/bin/bytebase-action
+COPY --from=builder /etc/ssl/certs /etc/ssl/certs
+CMD ["bytebase-action"]