ci: add docker build and release

This commit is contained in:
Aurelia 2025-06-04 00:42:44 +02:00
parent d07f505c8d
commit 34432fe059
No known key found for this signature in database
GPG key ID: FC2AFB709EA01596

53
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Create and publish a docker image
on:
workflow_dispatch:
push:
branches:
- master
tags:
- '\d+.\d+.\d+'
pull_request:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=tag,prefix=v
type=sha
- name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}