Add dockerfile and CI

This commit is contained in:
ast-ak47
2026-07-10 22:32:39 +09:00
parent d4b55a17a0
commit bb12956bd2
2 changed files with 38 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
name: Docker Image CI
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/ayamine47/sumika:latest
+12
View File
@@ -0,0 +1,12 @@
FROM golang:alpine AS build
ADD . /go/src/sumika/
ARG GOARCH=amd64
ENV GOARCH ${GOARCH}
ENV CGO_ENABLED 0
WORKDIR /go/src/sumika
RUN go build .
FROM alpine
COPY --from=build /go/src/sumika /bin/sumika
WORKDIR /data
CMD sumika