config pour génération d'image docker à la création de release

This commit is contained in:
2026-05-23 21:45:56 +02:00
parent 70ad0043a2
commit 9af9ddd8cb
4 changed files with 67 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
name: Release
on:
release:
types: [published]
jobs:
docker:
name: Build & push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Extract registry host from server URL
id: registry
run: |
HOST=$(echo '${{ gitea.server_url }}' | sed 's|https://||' | sed 's|http://||')
echo "host=${HOST}" >> $GITHUB_OUTPUT
echo "image=${HOST}/${{ gitea.repository }}" >> $GITHUB_OUTPUT
- name: Login to Gitea container registry
uses: https://github.com/docker/login-action@v3
with:
registry: ${{ steps.registry.outputs.host }}
username: ${{ gitea.actor }}
password: ${{ secrets.RELEASE_TOKEN }}
- name: Build and push
uses: https://github.com/docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ steps.registry.outputs.image }}:${{ gitea.ref_name }}
${{ steps.registry.outputs.image }}:latest