Skip to content

Commit

Permalink
Docker image build via GitHub Actions (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
valar999 authored Dec 15, 2020
1 parent be50479 commit f7760f0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: spacemeshos/explorer-apiserver
dockerfile: Dockerfile.apiserver
tag_with_ref: true

- uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: spacemeshos/explorer-collector
dockerfile: Dockerfile.collector
tag_with_ref: true
9 changes: 4 additions & 5 deletions Dockerfile.apiserver
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM golang:1.14.6-alpine3.12 AS build
FROM golang:1.15.6-alpine3.12 AS build
WORKDIR /src
RUN apk add bash make git
COPY . .
RUN make apiserver
RUN go build -o explorer-api ./cmd/apiserver/

FROM alpine:3.12
COPY --from=build /src/build/apiserver /bin/explorer-api
EXPOSE 6060
COPY --from=build /src/explorer-api /bin/
EXPOSE 5000
ENTRYPOINT ["/bin/explorer-api"]
8 changes: 3 additions & 5 deletions Dockerfile.collector
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM golang:1.14.6-alpine3.12 AS build
FROM golang:1.15.6-alpine3.12 AS build
WORKDIR /src
RUN apk add bash make git
COPY . .
RUN make collector
RUN go build -o explorer-collector ./cmd/collector/

FROM alpine:3.12
COPY --from=build /src/build/collector /bin/explorer-collector
EXPOSE 6060
COPY --from=build /src/explorer-collector /bin/
ENTRYPOINT ["/bin/explorer-collector"]

0 comments on commit f7760f0

Please sign in to comment.