mirror of
https://github.com/cert-manager/webhook-example.git
synced 2025-07-01 22:35:49 +02:00
add github ci
This commit is contained in:
parent
962afa45e0
commit
1b6eb43298
2 changed files with 37 additions and 3 deletions
34
.github/workflows/push.yml
vendored
Normal file
34
.github/workflows/push.yml
vendored
Normal 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 }}
|
|
@ -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"]
|
||||
|
|
Loading…
Reference in a new issue