Skip to content

Publish Docker Images #2

Publish Docker Images

Publish Docker Images #2

Workflow file for this run

name: Publish Docker Images
on:
workflow_dispatch:
inputs:
docker_image_tag:
description: 'Docker Image Tag (yyyyMMdd)'
required: true
env:
DEBIAN_FRONTEND: noninteractive
DOCKER_IMAGE_NAME1: "ubuntu24-dotnet8-opencv4.12.0"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
timeout-minutes: 60
steps:
- name: validate input
run: |
if [[ ! ${{ github.event.inputs.docker_image_tag }} =~ ^[0-9]{8}$ ]]; then
echo "::error Invalid tag name '${{ github.event.inputs.docker_image_tag }}'"
exit 1
fi
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Log into registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: docker/${{ env.DOCKER_IMAGE_NAME1 }}
push: true
tags: ghcr.io/shimat/opencvsharp/${{ env.DOCKER_IMAGE_NAME1 }}:${{ github.event.inputs.docker_image_tag }}