feat: fix manuel pipline. to create a release tag or replace exisiting release
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
APP_ENV=dev
|
APP_ENV=dev
|
||||||
APP_DEBUG=0
|
APP_DEBUG=1
|
||||||
APP_SECRET=changeme_replace_with_random_32char_string
|
APP_SECRET=changeme_replace_with_random_32char_string
|
||||||
|
|
||||||
# Comma-separated list of allowed hostnames. Leave empty to allow all hosts.
|
# 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=
|
ALLOWED_HOSTS=
|
||||||
|
|
||||||
# GitHub
|
# GitHub
|
||||||
GITHUB_USER=
|
GITHUB_USER=ArthurErlich
|
||||||
GITHUB_TOKEN=
|
GITHUB_TOKEN=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
|
||||||
|
|
||||||
# GitLab (leave GITLAB_URL empty to use https://gitlab.com)
|
# GitLab (leave GITLAB_URL empty to use https://gitlab.com)
|
||||||
GITLAB_USER=
|
GITLAB_USER=
|
||||||
@@ -16,6 +16,6 @@ GITLAB_TOKEN=
|
|||||||
GITLAB_URL=
|
GITLAB_URL=
|
||||||
|
|
||||||
# Gitea
|
# Gitea
|
||||||
GITEA_USER=
|
GITEA_USER=haylan
|
||||||
GITEA_TOKEN=
|
GITEA_TOKEN=00978ce106e5291b521d3669b77dc897004f7a4b
|
||||||
GITEA_URL=
|
GITEA_URL=https://git.arthurerlich.de
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# Builds and pushes a multi-arch Docker image to the Gitea container registry
|
# Builds and pushes a multi-arch Docker image to the Gitea container registry.
|
||||||
# whenever a semver tag (v*.*.*) is pushed.
|
# 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:
|
# One-time setup required:
|
||||||
# 1. Create a Gitea token with "package:write" scope.
|
# 1. Create a Gitea token with "package:write" scope.
|
||||||
@@ -12,9 +13,12 @@
|
|||||||
name: Docker Publish
|
name: Docker Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
tags:
|
inputs:
|
||||||
- 'v*.*.*'
|
tag:
|
||||||
|
description: 'Release tag (semver, e.g. 1.2.3)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-push:
|
build-push:
|
||||||
@@ -23,6 +27,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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.
|
# Strip the protocol from the server URL to get the registry hostname.
|
||||||
# e.g. https://gitea.example.com → gitea.example.com
|
# e.g. https://gitea.example.com → gitea.example.com
|
||||||
@@ -30,17 +44,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "REGISTRY=$(echo '${{ gitea.server_url }}' | sed 's|https://||;s|http://||')" >> $GITHUB_ENV
|
echo "REGISTRY=$(echo '${{ gitea.server_url }}' | sed 's|https://||;s|http://||')" >> $GITHUB_ENV
|
||||||
|
|
||||||
# Generates OCI-compliant tags and labels from the git tag.
|
# Generates OCI-compliant tags and labels from the provided release tag.
|
||||||
# v1.2.3 → image tags: 1.2.3 / 1.2 / 1
|
# 1.2.3 → image tags: 1.2.3 / 1.2 / 1
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ gitea.repository }}
|
images: ${{ env.REGISTRY }}/${{ gitea.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}},value=${{ inputs.tag }}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.tag }}
|
||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}},value=${{ inputs.tag }}
|
||||||
|
|
||||||
# QEMU enables emulation of arm64 on the amd64 runner.
|
# QEMU enables emulation of arm64 on the amd64 runner.
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
|
|||||||
@@ -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
|
## Docker
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
|
|||||||
Reference in New Issue
Block a user