1
1
mirror of https://github.com/mcuadros/ascode synced 2024-11-23 01:11:59 +01:00

ci: docker build based on github actions

This commit is contained in:
Máximo Cuadros 2020-03-17 18:30:53 +01:00
parent 239a9ab9c0
commit 050d289620
No known key found for this signature in database
GPG Key ID: 17A5DFEDC735AE4B
2 changed files with 25 additions and 0 deletions

16
.github/workflows/docker.yml vendored Normal file

@ -0,0 +1,16 @@
name: Docker Push
on: [push, create]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Docker image
uses: mr-smithers-excellent/docker-build-push@v2
with:
image: mcuadros/ascode
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

9
Dockerfile Normal file

@ -0,0 +1,9 @@
FROM golang:1.14.0-alpine AS builder
WORKDIR $GOPATH/src/github.com/mcuadros/ascode
COPY . .
RUN GO111MODULE=on CGO_ENABLED=0 GOPROXY="https://proxy.golang.org" go build -o /bin/ascode .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=builder /bin/ascode /bin/ascode
CMD ["ascode"]