Commit 73b637b

Anton Medvedev <anton@medv.io>
2025-11-30 14:51:50
Add release workflow and Dockerfile for building and publishing
1 parent 8c9f660
Changed files (2)
.github/workflows/release.yaml
@@ -0,0 +1,31 @@
+name: release
+
+on:
+  release:
+    types: [ created ]
+  workflow_dispatch:
+
+jobs:
+  docker:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Login to Docker Hub
+        uses: docker/login-action@v3
+        with:
+          username: antonmedv
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v3
+
+      - name: Build and push
+        uses: docker/build-push-action@v5
+        with:
+          context: .
+          file: ./Dockerfile
+          push: true
+          platforms: linux/amd64,linux/arm64
+          tags: antonmedv/gitmal:latest
Dockerfile
@@ -0,0 +1,21 @@
+FROM golang:latest as builder
+
+WORKDIR /go
+
+COPY go.mod go.sum ./
+
+RUN go mod download
+
+COPY . .
+
+RUN go build -o gitmal .
+
+FROM alpine
+
+COPY --from=builder /go/gitmal /bin/gitmal
+
+WORKDIR /data
+
+ENV COLORTERM=truecolor
+
+ENTRYPOINT ["/bin/gitmal"]