Skip to content

Create and publish Docker runner image #294

Create and publish Docker runner image

Create and publish Docker runner image #294

Workflow file for this run

name: Create and publish Docker runner image
on:
workflow_dispatch:
push:
branches: ["main"]
schedule:
- cron: "0 9 * * *"
env:
REGISTRY: ghcr.io
SERVICE: marathon-runner
ORG: zenlist
jobs:
build-and-push-image:
runs-on: github-large-docker
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.SERVICE }}
tags: |
type=raw,value={{branch}}
type=raw,value={{branch}}-{{sha}}-{{date 'YYYYMMDD-HHmmss'}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
- name: Build and push
id: push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}