Skip to content

Build Container

Build Container #2

Workflow file for this run

name: Build Container
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
GITHUB_REPO: ${{ github.repository }}
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:
- 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.GITHUB_REPO }}
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: docker/build-push-action@v6
with:
file: Dockerfile.${{ matrix.os.docker }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}