From 159eab5d1ce8e6e52129b602e3b082394dcda61f Mon Sep 17 00:00:00 2001 From: Thijs Herman <64640608+Turbootzz@users.noreply.github.com> Date: Sat, 21 Feb 2026 12:15:43 +0100 Subject: [PATCH] chore: multi-arch Docker build (amd64, arm64, armv7) (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: multi-arch Docker build (amd64, arm64, armv7) - Remove hardcoded GOARCH=amd64 from Dockerfile, use TARGETARCH ARG - Add QEMU + buildx to CI for cross-compilation - Build for linux/amd64, linux/arm64, linux/arm/v7 * chore: update action versions, add dependabot - actions/checkout v4 → v6 - actions/setup-go v5 → v6 - Add dependabot.yml (monthly checks for Go, Actions, Docker) --- .github/dependabot.yml | 41 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 11 ++++++++--- Dockerfile | 5 ++++- 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..fbd4c3f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,41 @@ +version: 2 +updates: + # Go modules + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "monthly" + labels: + - "dependencies" + commit-message: + prefix: "chore(deps)" + groups: + go-dependencies: + patterns: + - "*" + + # GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + labels: + - "dependencies" + - "ci" + commit-message: + prefix: "chore(ci)" + groups: + actions-dependencies: + patterns: + - "*" + + # Docker + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "monthly" + labels: + - "dependencies" + - "docker" + commit-message: + prefix: "chore(docker)" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cc073d..84af9ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v6 with: go-version-file: go.mod @@ -30,7 +30,11 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + + - uses: docker/setup-qemu-action@v3 + + - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: @@ -42,4 +46,5 @@ jobs: with: context: . push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 tags: ghcr.io/turbootzz/vaultwarden-api:latest diff --git a/Dockerfile b/Dockerfile index 6c147e8..4bc1e21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,10 @@ COPY go.mod go.sum ./ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ +ARG TARGETOS=linux +ARG TARGETARCH=amd64 + +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \ -ldflags="-s -w" \ -o /build/vaultwarden-api \ ./cmd/api