Compare commits

..

No commits in common. "c56c39f2c54b0afa90a2b57fc2f7a1c33ece64e6" and "e0c78d68fe5e497e482c6d7670cd45e6a22390c4" have entirely different histories.

View file

@ -7,9 +7,8 @@ on:
workflow_dispatch:
inputs:
version:
description: "เวอร์ชันที่จะ deploy เช่น 1.2.3 (ว่าง = latest)"
required: false
type: string
description: "เวอร์ชันที่จะ deploy เช่น 1.2.3 / v1.2.3 / deploy1.2.3 — จะ map เป็น image v1.2.3 (ต้อง push tag v1.2.3 ให้ build.yml build ไว้ก่อน)"
required: true
env:
# Container Registry
@ -103,20 +102,13 @@ jobs:
outputs:
image_tag: ${{ steps.image-tag.outputs.tag }}
steps:
- name: Resolve image tag (deploy1.2.3 / v1.2.3 → v1.2.3, ว่าง → latest)
- name: Resolve image tag (deploy1.2.3 / v1.2.3 → v1.2.3)
id: image-tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
RAW="${{ github.event.inputs.version }}"
else
RAW="${{ github.ref_name }}"
fi
TAG="latest"
if [ -n "$RAW" ]; then
TAG="${RAW#deploy}"
TAG="${TAG#v}"
TAG="v$TAG"
fi
RAW="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || github.ref_name }}"
TAG="${RAW#deploy}"
TAG="${TAG#v}"
TAG="v$TAG"
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Reuse image จาก build.yml: ${{ env.REGISTRY_URL }}/${{ env.WEB_IMAGE_NAME }}:$TAG"