set auto build
This commit is contained in:
parent
c0d8d80fa9
commit
e4f6bc1b01
2 changed files with 79 additions and 119 deletions
39
.github/workflows/build-local.yaml
vendored
39
.github/workflows/build-local.yaml
vendored
|
|
@ -1,39 +0,0 @@
|
||||||
# use for local build with act
|
|
||||||
name: build-local
|
|
||||||
run-name: build-local ${{ github.actor }}
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
env:
|
|
||||||
REGISTRY: docker.frappet.com
|
|
||||||
IMAGE_NAME: demo/bma-ehr-app
|
|
||||||
jobs:
|
|
||||||
# act workflow_dispatch -W .github/workflows/build-local.yaml --input IMAGE_VER=test-v1
|
|
||||||
build-local:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
# skip Set up QEMU because it fail on act and container
|
|
||||||
- name: Gen Version
|
|
||||||
id: gen_ver
|
|
||||||
run: |
|
|
||||||
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
|
|
||||||
IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
|
|
||||||
else
|
|
||||||
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
|
|
||||||
fi
|
|
||||||
if [[ $IMAGE_VER == '' ]]; then
|
|
||||||
IMAGE_VER='test-vBeta'
|
|
||||||
fi
|
|
||||||
echo '::set-output name=image_ver::'$IMAGE_VER
|
|
||||||
- name: Test Version
|
|
||||||
run: |
|
|
||||||
echo $GITHUB_REF
|
|
||||||
echo ${{ steps.gen_ver.outputs.image_ver }}
|
|
||||||
|
|
||||||
- name: Build and load local docker image
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64
|
|
||||||
load: true
|
|
||||||
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
|
|
||||||
5
.github/workflows/release.yaml
vendored
5
.github/workflows/release.yaml
vendored
|
|
@ -13,7 +13,6 @@ env:
|
||||||
IMAGE_NAME: ehr/bma-ehr-faq
|
IMAGE_NAME: ehr/bma-ehr-faq
|
||||||
DEPLOY_HOST: frappet.com
|
DEPLOY_HOST: frappet.com
|
||||||
COMPOSE_PATH: /home/frappet/docker/bma-ehr-faq
|
COMPOSE_PATH: /home/frappet/docker/bma-ehr-faq
|
||||||
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
|
|
||||||
jobs:
|
jobs:
|
||||||
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
|
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
|
||||||
release-test:
|
release-test:
|
||||||
|
|
@ -69,7 +68,7 @@ jobs:
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
- uses: snow-actions/line-notify@v1.1.0
|
||||||
if: success()
|
if: success()
|
||||||
with:
|
with:
|
||||||
access_token: ${{ env.TOKEN_LINE }}
|
access_token: ${{ secrets.TOKEN_LINE }}
|
||||||
message: |
|
message: |
|
||||||
-Success✅✅✅
|
-Success✅✅✅
|
||||||
Image: ${{env.IMAGE_NAME}}
|
Image: ${{env.IMAGE_NAME}}
|
||||||
|
|
@ -78,7 +77,7 @@ jobs:
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
- uses: snow-actions/line-notify@v1.1.0
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
access_token: ${{ env.TOKEN_LINE }}
|
access_token: ${{ secrets.TOKEN_LINE }}
|
||||||
message: |
|
message: |
|
||||||
-Failure❌❌❌
|
-Failure❌❌❌
|
||||||
Image: ${{env.IMAGE_NAME}}
|
Image: ${{env.IMAGE_NAME}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue