config pour génération d'image docker à la création de release
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user