46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
---
|
|
name: release
|
|
on:
|
|
release:
|
|
types: [published]
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
- name: Set up docker
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Log in to the Gitea container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ gitea.server_url }}
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.PACKAGES_TOKEN }}
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: >-
|
|
${{ gitea.server_url }}
|
|
/
|
|
${{ gitea.repository_owner }}
|
|
/
|
|
${{ gitea.repository }}
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
- name: Build and push docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|