| 1 |
name: Kind image |
| 2 |
on: |
| 3 |
push: |
| 4 |
tags: |
| 5 |
- 'v*' |
| 6 |
|
| 7 |
env: |
| 8 |
REGISTRY: ghcr.io |
| 9 |
IMAGE_NAME: ${{ github.repository }} |
| 10 |
|
| 11 |
jobs: |
| 12 |
kind-image: |
| 13 |
runs-on: ubuntu-22.04 |
| 14 |
name: Kind image |
| 15 |
steps: |
| 16 |
- name: Checkout |
| 17 |
uses: actions/checkout@v3 |
| 18 |
|
| 19 |
- name: Docker meta |
| 20 |
id: meta |
| 21 |
uses: docker/metadata-action@v4 |
| 22 |
with: |
| 23 |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 24 |
tags: | |
| 25 |
type=semver,pattern={{version}}-kind |
| 26 |
|
| 27 |
- name: Login to GHCR |
| 28 |
if: github.event_name != 'pull_request' |
| 29 |
uses: docker/login-action@v2 |
| 30 |
with: |
| 31 |
registry: ${{ env.REGISTRY }} |
| 32 |
username: ${{ github.actor }} |
| 33 |
password: ${{ secrets.GITHUB_TOKEN }} |
| 34 |
|
| 35 |
- name: Build and push |
| 36 |
uses: docker/[email protected] |
| 37 |
with: |
| 38 |
context: . |
| 39 |
push: ${{ github.event_name != 'pull_request' }} |
| 40 |
tags: ${{ steps.meta.outputs.tags }} |
| 41 |
labels: ${{ steps.meta.outputs.labels }} |