refac:updated ci/cd pipeline to create docker images with timestamp and commit sha
Build & Deploy (develop) / build-and-deploy (push) Successful in 2m17s

This commit is contained in:
2026-09-29 10:59:09 +03:30
parent 92a3f014a6
commit b93c780fea
2 changed files with 20 additions and 8 deletions
+11 -2
View File
@@ -2,7 +2,8 @@ name: Rollback (develop)
# Trigger manually from the Gitea Actions UI.
# Leave "sha" empty to roll back to the previous deploy.
# Fill "sha" in (short 7-char form, e.g. a3f9c21) to roll back to a specific past build.
# Fill "sha" in (short 7-char form, e.g. a3f9c21) to roll back to the newest
# build for that commit. Build tags include a UTC timestamp and commit SHA.
on:
workflow_dispatch:
inputs:
@@ -18,7 +19,15 @@ jobs:
- name: Determine target tag
run: |
if [ -n "${{ gitea.event.inputs.sha }}" ]; then
TAG="${{ gitea.event.inputs.sha }}"
SHA="${{ gitea.event.inputs.sha }}"
TAG=$(docker images robot-market --format '{{.Tag}}' \
| grep -E "-${SHA}$" \
| sort -r \
| head -n 1)
# Keep accepting legacy SHA-only tags created before timestamped tags.
if [ -z "$TAG" ]; then
TAG="$SHA"
fi
else
TAG=$(grep IMAGE_TAG /opt/robot-market-front/.env.previous | cut -d= -f2)
fi