From fd5e24ff337d7fb8acc0ea3551e5faae4f293c7b Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 11 Jan 2024 12:15:04 +0700 Subject: [PATCH 1/3] set auto build --- .github/workflows/release.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b285aaa..a3a90e1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,5 @@ -name: release-dev -run-name: release-dev ${{ github.actor }} +name: release-test +run-name: release-test ${{ github.actor }} on: # push: # tags: @@ -13,11 +13,10 @@ env: IMAGE_NAME: ehr/bma-ehr-user DEPLOY_HOST: frappet.com COMPOSE_PATH: /home/frappet/docker/bma-ehr-user - TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0 jobs: # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v6.1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd - release-dev: + release-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -69,7 +68,7 @@ jobs: - uses: snow-actions/line-notify@v1.1.0 if: success() with: - access_token: ${{ env.TOKEN_LINE }} + access_token: ${{ secrets.TOKEN_LINE }} message: | -Success✅✅✅ Image: ${{env.IMAGE_NAME}} @@ -78,7 +77,7 @@ jobs: - uses: snow-actions/line-notify@v1.1.0 if: failure() with: - access_token: ${{ env.TOKEN_LINE }} + access_token: ${{ secrets.TOKEN_LINE }} message: | -Failure❌❌❌ Image: ${{env.IMAGE_NAME}} From 30718ecf6143f3de047ed852c3529f9afec955ae Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 11 Jan 2024 12:56:53 +0700 Subject: [PATCH 2/3] test auto build --- .github/workflows/release.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a3a90e1..72e1760 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,12 +1,9 @@ name: release-test run-name: release-test ${{ github.actor }} on: - # push: - # tags: - # - 'v[0-9]+.[0-9]+.[0-9]+' - # tags-ignore: - # - '2.*' - # Allow run workflow manually from Action tab + push: + tags: + - "version-[0-9]+.[0-9]+.[0-9]+" workflow_dispatch: env: REGISTRY: docker.frappet.com @@ -21,11 +18,15 @@ jobs: steps: - uses: actions/checkout@v3 # skip Set up QEMU because it fail on act and container + # Gen Version try to get version from tag or inut + - name: Set output tags + id: vars + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Gen Version id: gen_ver run: | if [[ $GITHUB_REF == 'refs/tags/'* ]]; then - IMAGE_VER='${GITHUB_REF/refs\/tags\//}' + IMAGE_VER=${{ steps.vars.outputs.tag }} else IMAGE_VER=${{ github.event.inputs.IMAGE_VER }} fi From 1300c11421d3c3f9bbb07e8e50337b971fb9a21a Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 11 Jan 2024 13:04:58 +0700 Subject: [PATCH 3/3] add tag version to line --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 72e1760..131c053 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -73,7 +73,7 @@ jobs: message: | -Success✅✅✅ Image: ${{env.IMAGE_NAME}} - Version: ${{ github.event.inputs.IMAGE_VER }} + Version: ${{ steps.gen_ver.outputs.IMAGE_VER }} By: ${{secrets.DOCKER_USER}} - uses: snow-actions/line-notify@v1.1.0 if: failure() @@ -82,5 +82,5 @@ jobs: message: | -Failure❌❌❌ Image: ${{env.IMAGE_NAME}} - Version: ${{ github.event.inputs.IMAGE_VER }} + Version: ${{ steps.gen_ver.outputs.IMAGE_VER }} By: ${{secrets.DOCKER_USER}}