From 888b83b1f5571406d721463dd475948acbc698cd Mon Sep 17 00:00:00 2001 From: DavidSpek Date: Fri, 29 Jul 2022 15:52:44 +0200 Subject: [PATCH] add github CI Signed-off-by: DavidSpek --- .github/workflows/publish.yaml | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..2d0c444 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,63 @@ +name: CD / cert-manager webhook + +on: + push: + tags: + - 'v*.*.*' +jobs: + publish: + name: Build and push Console container + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + permissions: + contents: 'read' + id-token: 'write' + packages: 'write' + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + dkr.plural.sh/bootstrap/plural-certmanager-webhook + gcr.io/pluralsh/plural-certmanager-webhook + ghcr.io/pluralsh/plural-certmanager-webhook + # generate Docker tags based on the following events/attributes + tags: | + type=semver,pattern={{version}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - uses: google-github-actions/auth@v0 + with: + workload_identity_provider: 'projects/${{ secrets.GOOGLE_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github' + service_account: 'terraform@pluralsh.iam.gserviceaccount.com' + token_format: 'access_token' + create_credentials_file: true + - uses: google-github-actions/setup-gcloud@v0.3.0 + - name: Login to gcr + run: gcloud auth configure-docker -q + - name: Login to plural registry + uses: docker/login-action@v1 + with: + registry: dkr.plural.sh + username: mjg@plural.sh + password: ${{ secrets.PLURAL_ACCESS_TOKEN }} + - name: Login to GHCR + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: "." + file: "./Dockerfile" + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}