feat: fix manuel pipline. to create a release tag or replace exisiting release

This commit is contained in:
2026-05-29 19:20:32 +02:00
parent cceda8abf2
commit 5feae97dd3
3 changed files with 48 additions and 16 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
APP_ENV=dev
APP_DEBUG=0
APP_DEBUG=1
APP_SECRET=changeme_replace_with_random_32char_string
# Comma-separated list of allowed hostnames. Leave empty to allow all hosts.
@@ -7,8 +7,8 @@ APP_SECRET=changeme_replace_with_random_32char_string
ALLOWED_HOSTS=
# GitHub
GITHUB_USER=
GITHUB_TOKEN=
GITHUB_USER=ArthurErlich
GITHUB_TOKEN=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
# GitLab (leave GITLAB_URL empty to use https://gitlab.com)
GITLAB_USER=
@@ -16,6 +16,6 @@ GITLAB_TOKEN=
GITLAB_URL=
# Gitea
GITEA_USER=
GITEA_TOKEN=
GITEA_URL=
GITEA_USER=haylan
GITEA_TOKEN=00978ce106e5291b521d3669b77dc897004f7a4b
GITEA_URL=https://git.arthurerlich.de
+24 -10
View File
@@ -1,5 +1,6 @@
# Builds and pushes a multi-arch Docker image to the Gitea container registry
# whenever a semver tag (v*.*.*) is pushed.
# Builds and pushes a multi-arch Docker image to the Gitea container registry.
# Triggered manually via workflow_dispatch — enter an existing semver tag (e.g. 1.2.3)
# in the "Release tag" input. The workflow will fail early if the tag does not exist.
#
# One-time setup required:
# 1. Create a Gitea token with "package:write" scope.
@@ -12,9 +13,12 @@
name: Docker Publish
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag (semver, e.g. 1.2.3)'
required: true
type: string
jobs:
build-push:
@@ -23,6 +27,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate tag exists
run: |
if ! git rev-parse "refs/tags/${{ inputs.tag }}" >/dev/null 2>&1; then
echo "Error: tag '${{ inputs.tag }}' does not exist in this repository."
exit 1
fi
git checkout "refs/tags/${{ inputs.tag }}"
# Strip the protocol from the server URL to get the registry hostname.
# e.g. https://gitea.example.com → gitea.example.com
@@ -30,17 +44,17 @@ jobs:
run: |
echo "REGISTRY=$(echo '${{ gitea.server_url }}' | sed 's|https://||;s|http://||')" >> $GITHUB_ENV
# Generates OCI-compliant tags and labels from the git tag.
# v1.2.3 → image tags: 1.2.3 / 1.2 / 1
# Generates OCI-compliant tags and labels from the provided release tag.
# 1.2.3 → image tags: 1.2.3 / 1.2 / 1
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ gitea.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern={{version}},value=${{ inputs.tag }}
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.tag }}
type=semver,pattern={{major}},value=${{ inputs.tag }}
# QEMU enables emulation of arm64 on the amd64 runner.
- name: Set up QEMU
+18
View File
@@ -117,6 +117,24 @@ Add to `.claude/settings.json` to run PHPUnit automatically after every file edi
}
```
## Gitea Workflows
Workflow files live in [.gitea/workflows/](.gitea/workflows/). This project uses Gitea Actions (GitHub Actions-compatible syntax).
**When editing workflow files:**
- Use `gitea.*` context variables, not `github.*` — e.g. `${{ gitea.server_url }}`, `${{ gitea.actor }}`, `${{ gitea.repository }}`
- `GITHUB_ENV` and `GITHUB_OUTPUT` are still the correct env file names (Gitea Actions re-uses these)
- Secrets are set under Repository → Settings → Secrets → Actions
- The registry hostname must be derived from `gitea.server_url` (strip the protocol prefix)
- Triggers use standard `on:` syntax; `tags: '*.*.*'` matches semver pushes without a `v` prefix
**Current workflows:**
| File | Trigger | Purpose |
|---|---|---|
| `docker-publish.yml` | Push tag `*.*.*` | Build & push multi-arch image to Gitea container registry |
## Docker
### Development