mirror of https://github.com/dirtbags/moth.git
Container image CI build
This commit is contained in:
parent
2391ebe27b
commit
81cbed3a94
|
@ -10,3 +10,11 @@ jobs:
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Build mothd
|
- name: Build mothd
|
||||||
run: docker build .
|
run: docker build .
|
||||||
|
- name: Push to GitHub Packages
|
||||||
|
uses: docker/build-push-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
registry: docker.pkg.github.com
|
||||||
|
repository: dirtbags/moth/moth
|
||||||
|
tag-with-ref: true
|
||||||
|
|
16
Dockerfile
16
Dockerfile
|
@ -2,14 +2,18 @@ FROM golang:1.13 AS builder
|
||||||
COPY go.* /src/
|
COPY go.* /src/
|
||||||
COPY pkg /src/pkg/
|
COPY pkg /src/pkg/
|
||||||
COPY cmd /src/cmd/
|
COPY cmd /src/cmd/
|
||||||
|
COPY theme /target/theme/
|
||||||
|
COPY example-puzzles /target/puzzles/
|
||||||
|
COPY LICENSE.md /target/
|
||||||
WORKDIR /src/
|
WORKDIR /src/
|
||||||
#RUN go test ./...
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go install -i -a -ldflags '-extldflags "-static"' ./...
|
RUN CGO_ENABLED=0 GOOS=linux go install -i -a -ldflags '-extldflags "-static"' ./...
|
||||||
|
RUN mkdir -p /target/bin
|
||||||
|
RUN cp /go/bin/* /target/bin/
|
||||||
|
|
||||||
|
FROM builder AS tester
|
||||||
|
RUN go test ./...
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /go/bin/* /usr/bin/
|
COPY --from=builder /target /
|
||||||
COPY theme /theme/
|
|
||||||
COPY example-puzzles /puzzles/
|
|
||||||
COPY LICENSE.md /LICENSE.md
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/bin/mothd" ]
|
ENTRYPOINT [ "/bin/mothd" ]
|
||||||
|
|
Loading…
Reference in New Issue