Skip to content

schedule jobs from container labels #9

schedule jobs from container labels

schedule jobs from container labels #9

name: Build Container Image
on:
push:
branches:
- "main"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
jobs:
container_image:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Docker meta"
id: "meta"
uses: "docker/metadata-action@v5"
with:
images: |
ghcr.io/dmipeck/docker-cron
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: "Set up Docker Buildx"
uses: "docker/setup-buildx-action@v3"
- name: "Build and push"
uses: "docker/build-push-action@v6"
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}