add github ci

This commit is contained in:
Robin Scherrer 2021-03-03 15:40:21 +01:00
parent 962afa45e0
commit 1b6eb43298
2 changed files with 37 additions and 3 deletions

34
.github/workflows/push.yml vendored Normal file
View file

@ -0,0 +1,34 @@
---
on:
release:
types:
- created
jobs:
multi-arch-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Prepare release tag
id: tag
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
containeroo/cert-manager-webhook-bluecat:latest
containeroo/cert-manager-webhook-bluecat:${{ steps.tag.outputs.version }}

View file

@ -13,12 +13,12 @@ FROM build_deps AS build
COPY . .
RUN CGO_ENABLED=0 go build -o webhook -ldflags '-w -extldflags "-static"' .
RUN CGO_ENABLED=0 go build -o bluecat-webhook -ldflags '-w -extldflags "-static"' .
FROM alpine:3.9
RUN apk add --no-cache ca-certificates
COPY --from=build /workspace/webhook /usr/local/bin/webhook
COPY --from=build /workspace/bluecat-webhook /usr/local/bin/bluecat-webhook
ENTRYPOINT ["webhook"]
ENTRYPOINT ["bluecat-webhook"]