diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0028ce7..0ffbcfe 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,6 +2,11 @@ name: build
on:
workflow_dispatch:
+ inputs:
+ version:
+ description: version
+ required: true
+ type: string
jobs:
build:
@@ -14,6 +19,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
+ - name: Download Soju
+ run: |
+ curl --remote-name https://codeberg.org/emersion/soju/releases/download/v${{ github.event.inputs.version }}/soju-${{ github.event.inputs.version }}.tar.gz
+ tar -xvzf soju-${{ github.event.inputs.version }}.tar.gz
+ mv soju-${{ github.event.inputs.version }} soju
+
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -22,6 +33,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ghcr.io/kejadlen/soju
+ tags: |
+ type=semver,pattern={{version}},value=v${{ github.event.inputs.version }}
- name: Log in to the Container registry
uses: docker/login-action@v3
diff --git a/Dockerfile b/Dockerfile
index 52a0230..65555ff 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,9 +1,13 @@
-FROM debian:trixie-slim
+FROM golang:1.20 AS build
-RUN apt-get update && apt-get install -y \
- ca-certificates \
- soju
+COPY soju /soju/
+WORKDIR /soju
+RUN make soju
-RUN mkdir /app
+FROM gcr.io/distroless/base-debian12
+
+COPY --from=build /soju/soju /soju/sojudb /soju/sojuctl /usr/bin/
+
+WORKDIR /soju
CMD ["soju", "-config", "/soju/soju.conf"]