From 1b6eb43298b63225a5fa4395f2b6cc8c7f4e006f Mon Sep 17 00:00:00 2001 From: Robin Scherrer Date: Wed, 3 Mar 2021 15:40:21 +0100 Subject: [PATCH] add github ci --- .github/workflows/push.yml | 34 ++++++++++++++++++++++++++++++++++ Dockerfile | 6 +++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..e58a94a --- /dev/null +++ b/.github/workflows/push.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 9b49cee..2d8389b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"]