Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile
19 changes: 17 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,22 @@ jobs:

- name: Test
run: go test -v -tags skip ./...

- name: Build and push Docker images
if: success()
uses: docker/build-push-action@v2.3.0
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: gogems/jet:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
coverage:
runs-on: ubuntu-latest
steps:
Expand All @@ -43,4 +58,4 @@ jobs:
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
path-to-lcov: coverage.lcov
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM golang:1.16-alpine as BUILD
RUN apk --update upgrade \
&& apk --no-cache --no-progress add git bash gcc curl tar ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/cache/apk/*
WORKDIR /go/src/github.com/go-gems/jet

COPY go.mod .
COPY go.sum .
RUN GO111MODULE=on GOPROXY=https://proxy.golang.org go mod download

COPY . /go/src/github.com/go-gems/jet
RUN go build -o jet .

FROM alpine as RUN
COPY --from=BUILD /go/src/github.com/go-gems/jet/jet /usr/local/bin/jet
RUN chmod 777 /usr/local/bin/jet
EXPOSE 8000
ENTRYPOINT ["jet"]