.gitea/workflows/build-and-push.yaml aktualisiert
This commit is contained in:
@@ -371,11 +371,27 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --local user.email "action@pi-farm.de"
|
git config --local user.email "action@pi-farm.de"
|
||||||
git config --local user.name "Gitea Action"
|
git config --local user.name "Gitea Action"
|
||||||
|
|
||||||
|
# Sicherstellen, dass wir etwas zum Committen haben
|
||||||
git add VERSION.history README.md docker-compose.yml
|
git add VERSION.history README.md docker-compose.yml
|
||||||
|
|
||||||
|
# Nur committen, wenn es Änderungen gibt
|
||||||
git diff --quiet && git diff --staged --quiet || git commit -m "${{ env.FINAL_MSG }} [skip ci]"
|
git diff --quiet && git diff --staged --quiet || git commit -m "${{ env.FINAL_MSG }} [skip ci]"
|
||||||
git tag -f "v${{ steps.prep.outputs.docker_tag }}"
|
|
||||||
git push origin main
|
# Das Tag exakt so setzen, wie es in prep definiert wurde (ohne extra 'v')
|
||||||
git push -f origin "v${{ steps.prep.outputs.docker_tag }}"
|
TARGET_TAG="${{ steps.prep.outputs.docker_tag }}"
|
||||||
|
git tag -f "$TARGET_TAG"
|
||||||
|
|
||||||
|
if [[ "${{ gitea.ref }}" == refs/tags/* ]]; then
|
||||||
|
echo "🏷️ Build aus Tag getriggert: $TARGET_TAG"
|
||||||
|
# Wir pushen das Tag (force), um die Doku-Updates einzuschließen
|
||||||
|
git push -f origin "$TARGET_TAG"
|
||||||
|
else
|
||||||
|
echo "🌿 Build aus Branch/Schedule getriggert: ${{ gitea.ref_name }}"
|
||||||
|
# In den Branch pushen (HEAD:branch_name) und das Tag setzen
|
||||||
|
git push origin HEAD:${{ gitea.ref_name }}
|
||||||
|
git push -f origin "$TARGET_TAG"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Cleanup Temporary Tags on Docker Hub
|
- name: Cleanup Temporary Tags on Docker Hub
|
||||||
if: steps.check_changes.outputs.should_build == 'true' && contains(steps.prep.outputs.push_targets, 'dockerhub')
|
if: steps.check_changes.outputs.should_build == 'true' && contains(steps.prep.outputs.push_targets, 'dockerhub')
|
||||||
|
|||||||
Reference in New Issue
Block a user