Files
Bonsai-webapp/.gitea/workflows/release.yml
T
2026-05-23 22:14:22 +02:00

45 lines
1.4 KiB
YAML

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: Debug registry info
run: |
echo "Server URL: ${{ gitea.server_url }}"
echo "Actor: ${{ gitea.actor }}"
echo "Registry host: ${{ steps.registry.outputs.host }}"
echo "Token length: ${#RELEASE_TOKEN}"
env:
TOKEN: ${{ secrets.RELEASE_TOKEN }}
- 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