mirror of
https://github.com/cert-manager/webhook-example.git
synced 2025-07-01 22:35:49 +02:00
feat: Add publish docker workflow
This commit is contained in:
parent
6ad6542a5c
commit
8dce01843e
1 changed files with 37 additions and 0 deletions
37
.github/workflows/publish-docker.yaml
vendored
Normal file
37
.github/workflows/publish-docker.yaml
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
name: Publish Docker image
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_UERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: yn360sre/cert-manager-sotoon-acme-dns01-webhook
|
||||
tags: |
|
||||
type=raw,value={{sha}}
|
||||
type=semver,pattern={{version}}
|
||||
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.output.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
Loading…
Reference in a new issue