Skip to content

Build Container

Build Container #7

Workflow file for this run

name: Build Container
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build:
strategy:
matrix:
os:
- name: ubuntu-latest
docker: alpine
- name: windows-latest
docker: windows
runs-on: ${{ matrix.os.name }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- id: repo
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ""
flavor: |
suffix=-${{ matrix.os.docker }}
tags: |
type=raw,value=latest
type=raw,value=stable,enable=${{ github.event_name == 'release' }}
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
type=sha,priority=250,enable=${{ github.event_name == 'workflow_dispatch' }}
- name: Build and push Docker image
uses: mr-smithers-excellent/docker-build-push@v6
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.repo.outputs.lowercase }}
dockerfile: Dockerfile.${{ matrix.os.docker }}
labels: ${{ join(fromJson(steps.meta.outputs.json).labels, ',') }}
tags: ${{ join(fromJson(steps.meta.outputs.json).tags, ',') }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}