ci/docs: rely solely on branch name as DOCKER_TAG; remove tag triggers

This commit is contained in:
Nicolas Cantu 2025-09-10 12:39:36 +02:00
parent 9f05c31e0d
commit b926417227
2 changed files with 5 additions and 22 deletions

View File

@ -1,8 +1,6 @@
name: dev
on:
push:
tags:
- dev
branches:
- '*'
paths:
@ -22,8 +20,8 @@ jobs:
uses: docker/login-action@v3
with:
registry: git.4nkweb.com
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
username: ${{ secrets.USER }}
password: ${{ secrets.TOKEN }}
- name: Init submodules (ensure up-to-date)
run: |
git submodule sync --recursive
@ -32,14 +30,5 @@ jobs:
env:
REGISTRY: git.4nkweb.com
run: |
COMMIT_MSG=$(git log -1 --pretty=%B)
FROM_COMMIT=$(printf "%s" "$COMMIT_MSG" | sed -n 's/.*ci:[[:space:]]*docker_tag=\([^ ][^\n]*\).*/\1/p' | head -n1)
if [ -n "$FROM_COMMIT" ]; then
DOCKER_TAG="$FROM_COMMIT"
elif [ -f .ci/tag.env ]; then
# shellcheck disable=SC1091
. .ci/tag.env
else
DOCKER_TAG=$(git rev-parse --abbrev-ref HEAD)
fi
bash scripts/build_and_push.sh "$DOCKER_TAG"

View File

@ -3,17 +3,11 @@
## Workflow
- Fichier: `.gitea/workflows/dev.yml`
- Triggers:
- Push sur `dev`
- Push sur branches `dev-test*` modifiant `.ci/tag.env`
- Tag `dev`
- Trigger unique: push sur nimporte quelle branche (`*`).
## Résolution de DOCKER_TAG
1. Motif dans le dernier message de commit: `ci: docker_tag=<valeur>`
2. Fichier `.ci/tag.env` (clé `DOCKER_TAG=<valeur>`)
3. Nom de la branche (`GITHUB_REF_NAME`)
4. Secours: `dev-test`
- Nom de la branche courante (la branche est le `DOCKER_TAG`).
## Build