From 025ca2ce48b694314f76ed06cbcedc55b05e999e Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 17 Sep 2026 17:15:24 +0700 Subject: [PATCH 1/2] =?UTF-8?q?CD:=20uat.yml=20=E0=B9=81=E0=B8=81=E0=B9=89?= =?UTF-8?q?=20Run=20workflow=20=E0=B8=88=E0=B8=B2=E0=B8=81=20UI=20?= =?UTF-8?q?=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B9=84=E0=B8=94=E0=B9=89=E0=B8=9A?= =?UTF-8?q?=E0=B8=99=20Forgejo=2011=20=E2=80=94=20=E0=B8=AD=E0=B8=B2?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3:=20=E0=B8=81=E0=B8=94=20Run=20workf?= =?UTF-8?q?low=20=E0=B9=81=E0=B8=A5=E0=B9=89=E0=B8=A7=E0=B9=84=E0=B8=A1?= =?UTF-8?q?=E0=B9=88=E0=B8=A1=E0=B8=B5=E0=B8=8A=E0=B9=88=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=81=E0=B8=A3=E0=B8=AD=E0=B8=81=20version=20=E0=B9=81?= =?UTF-8?q?=E0=B8=95=E0=B9=88=20backend=20=E0=B8=82=E0=B8=A7=E0=B8=B2?= =?UTF-8?q?=E0=B8=87=E0=B8=94=E0=B9=89=E0=B8=A7=E0=B8=A2=20"Require=20valu?= =?UTF-8?q?e=20for=20input"=20(Forgejo=2011=20base=20Gitea=201.22=20=3D=20?= =?UTF-8?q?UI=20=E0=B8=A2=E0=B8=B1=E0=B8=87=E0=B9=84=E0=B8=A1=E0=B9=88=20r?= =?UTF-8?q?ender=20workflow=5Fdispatch=20input=20fields,=20Gitea=20?= =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1=E0=B9=83=E0=B8=99?= =?UTF-8?q?=201.23-1.24)=20=E2=80=94=20=E0=B9=81=E0=B8=81=E0=B9=89=202=20?= =?UTF-8?q?=E0=B8=8A=E0=B8=B1=E0=B9=89=E0=B8=99:=20(1)=20input=20=E0=B9=80?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=E0=B8=A1=20type:=20string=20=E0=B8=95?= =?UTF-8?q?=E0=B8=B2=E0=B8=A1=20GitHub=20spec=20=E0=B9=80=E0=B8=9C?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=20renderer=20=E0=B8=95=E0=B9=89?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=E0=B9=80=E0=B8=88=E0=B8=AD=20type=20?= =?UTF-8?q?=E0=B8=96=E0=B8=B6=E0=B8=87=E0=B8=A7=E0=B8=B2=E0=B8=94=E0=B8=8A?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=87=20(2)=20required:=20false=20+=20ste?= =?UTF-8?q?p=20Resolve=20=E0=B8=A3=E0=B8=AD=E0=B8=87=E0=B8=A3=E0=B8=B1?= =?UTF-8?q?=E0=B8=9A=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=A7=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=87:=20dispatch=20=E0=B9=82=E0=B8=94=E0=B8=A2=E0=B9=84?= =?UTF-8?q?=E0=B8=A1=E0=B9=88=E0=B9=83=E0=B8=AA=E0=B9=88=20version=20=3D?= =?UTF-8?q?=20deploy=20:latest=20(image=20=E0=B8=A5=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=AA=E0=B8=B8=E0=B8=94=E0=B8=97=E0=B8=B5=E0=B9=88=20build.?= =?UTF-8?q?yml=20push=20=E0=B8=95=E0=B8=AD=E0=B8=99=20tag=20v*=20=E2=80=94?= =?UTF-8?q?=20=E0=B8=84=E0=B8=B7=E0=B8=AD=E0=B9=80=E0=B8=A7=E0=B8=AD?= =?UTF-8?q?=E0=B8=A3=E0=B9=8C=E0=B8=8A=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B5?= =?UTF-8?q?=E0=B9=88=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=87=20deploy?= =?UTF-8?q?=20Test=20=E0=B9=84=E0=B8=9B)=20=E0=B9=83=E0=B8=AA=E0=B9=88?= =?UTF-8?q?=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=A1=E0=B8=B2=20(1.2.3/v1.2.3/d?= =?UTF-8?q?eploy1.2.3)=20=E0=B8=81=E0=B9=87=20map=20=E0=B9=80=E0=B8=9B?= =?UTF-8?q?=E0=B9=87=E0=B8=99=20v1.2.3=20=E0=B9=80=E0=B8=AB=E0=B8=A1?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B4=E0=B8=A1?= =?UTF-8?q?=20+=20=E0=B9=80=E0=B8=82=E0=B8=B5=E0=B8=A2=E0=B8=99=20if/else?= =?UTF-8?q?=20=E0=B9=81=E0=B8=A2=E0=B8=81=20event=20=E0=B9=81=E0=B8=97?= =?UTF-8?q?=E0=B8=99=20&&/||=20=E0=B9=80=E0=B8=9E=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=B0=20input=20=E0=B8=A7=E0=B9=88=E0=B8=B2=E0=B8=87?= =?UTF-8?q?=E0=B8=88=E0=B8=B0=20short-circuit=20=E0=B8=95=E0=B8=81?= =?UTF-8?q?=E0=B9=84=E0=B8=9B=E0=B9=83=E0=B8=8A=E0=B9=89=20ref=5Fname=20(?= =?UTF-8?q?=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=20branch)=20=E0=B9=80?= =?UTF-8?q?=E0=B8=81=E0=B8=B4=E0=B8=94=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=99?= =?UTF-8?q?=20image=20vdev=20=E2=80=94=20verify:=20js-yaml=20=E0=B8=9C?= =?UTF-8?q?=E0=B9=88=E0=B8=B2=E0=B8=99=20+=20=E0=B8=97=E0=B8=94=E0=B8=AA?= =?UTF-8?q?=E0=B8=AD=E0=B8=9A=20resolve=20=E0=B8=84=E0=B8=A3=E0=B8=9A=20(d?= =?UTF-8?q?eploy1.2.3/v1.2.3/1.2.3=20=E2=86=92=20v1.2.3,=20=E0=B8=A7?= =?UTF-8?q?=E0=B9=88=E0=B8=B2=E0=B8=87=20=E2=86=92=20latest)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- .forgejo/workflows/uat.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/uat.yml b/.forgejo/workflows/uat.yml index e38514c..a648843 100644 --- a/.forgejo/workflows/uat.yml +++ b/.forgejo/workflows/uat.yml @@ -7,8 +7,9 @@ on: workflow_dispatch: inputs: version: - 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 + description: "เวอร์ชันที่จะ deploy เช่น 1.2.3 / v1.2.3 / deploy1.2.3 — จะ map เป็น image v1.2.3 | เว้นว่าง = latest (image ล่าสุดที่ build.yml push ไว้)" + required: false + type: string env: # Container Registry @@ -102,13 +103,20 @@ jobs: outputs: image_tag: ${{ steps.image-tag.outputs.tag }} steps: - - name: Resolve image tag (deploy1.2.3 / v1.2.3 → v1.2.3) + - name: Resolve image tag (deploy1.2.3 / v1.2.3 → v1.2.3, ว่าง → latest) id: image-tag run: | - RAW="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || github.ref_name }}" - TAG="${RAW#deploy}" - TAG="${TAG#v}" - TAG="v$TAG" + 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 echo "tag=$TAG" >> $GITHUB_OUTPUT echo "Reuse image จาก build.yml: ${{ env.REGISTRY_URL }}/${{ env.WEB_IMAGE_NAME }}:$TAG" From c56c39f2c54b0afa90a2b57fc2f7a1c33ece64e6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 17 Sep 2026 17:16:30 +0700 Subject: [PATCH 2/2] =?UTF-8?q?CD:=20=E0=B8=A2=E0=B9=88=E0=B8=AD=20descrip?= =?UTF-8?q?tion=20=E0=B8=82=E0=B8=AD=E0=B8=87=20input=20version=20?= =?UTF-8?q?=E0=B9=83=E0=B8=99=20uat.yml=20=E0=B9=83=E0=B8=AB=E0=B9=89?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=89=E0=B8=99=E0=B8=A5=E0=B8=87=20?= =?UTF-8?q?=E2=80=94=20"=E0=B9=80=E0=B8=A7=E0=B8=AD=E0=B8=A3=E0=B9=8C?= =?UTF-8?q?=E0=B8=8A=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=88?= =?UTF-8?q?=E0=B8=B0=20deploy=20=E0=B9=80=E0=B8=8A=E0=B9=88=E0=B8=99=201.2?= =?UTF-8?q?.3=20(=E0=B8=A7=E0=B9=88=E0=B8=B2=E0=B8=87=20=3D=20latest)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- .forgejo/workflows/uat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/uat.yml b/.forgejo/workflows/uat.yml index a648843..d999b9e 100644 --- a/.forgejo/workflows/uat.yml +++ b/.forgejo/workflows/uat.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: version: - description: "เวอร์ชันที่จะ deploy เช่น 1.2.3 / v1.2.3 / deploy1.2.3 — จะ map เป็น image v1.2.3 | เว้นว่าง = latest (image ล่าสุดที่ build.yml push ไว้)" + description: "เวอร์ชันที่จะ deploy เช่น 1.2.3 (ว่าง = latest)" required: false type: string