Skip to content

🔧 Added docker labels and PR builds #40

🔧 Added docker labels and PR builds

🔧 Added docker labels and PR builds #40

Workflow file for this run

name: Build and Push Docker Image
on:
release:
types: [published]
pull_request:
types: [opened, synchronize]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/retigra/zabbixci
labels: |
org.opencontainers.image.title=ZabbixCI
org.opencontainers.image.description=Source control for Zabbix templates in Git
org.opencontainers.image.vendor=Retigra
org.opencontainers.image.license=AGPL-3.0
org.opencontainers.image.url=https://github.com/retigra/ZabbixCI
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: |
org.opencontainers.image.title=ZabbixCI
org.opencontainers.image.description=Source control for Zabbix templates in Git
org.opencontainers.image.license=MIT
org.opencontainers.image.source=https://github.com/retigra/zabbixci