Add dockerfile and CI
This commit is contained in:
@@ -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
@@ -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
|
||||||
Reference in New Issue
Block a user