playground-miniflake/.gitea/workflows/build-packages.yaml
DrMaxNix 5a21c94a79
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
change
2024-04-20 16:28:10 +02:00

46 lines
1.3 KiB
YAML

name: Build and Publish Docker Packages
on:
release:
types:
- published
env:
REGISTRY: git.tjdev.de
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-publish-docker-packages:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: https://github.com/actions/checkout@v4
- name: Login to Git Container Registry
uses: https://github.com/docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.GIT_PACKREG_USERNAME }}
password: ${{ secrets.GIT_PACKREG_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
type=sha
- name: Build and push Docker image
uses: https://github.com/docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}