test build discord
This commit is contained in:
parent
b3dad2d6fc
commit
555636ed2a
1 changed files with 41 additions and 22 deletions
63
.github/workflows/release.yaml
vendored
63
.github/workflows/release.yaml
vendored
|
|
@ -1,19 +1,19 @@
|
||||||
name: release-test
|
name: release
|
||||||
run-name: release-test ${{ github.actor }}
|
run-name: release ${{ github.actor }}
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'version-[0-9]+.[0-9]+.[0-9]+'
|
- "version-[0-9]+.[0-9]+.[0-9]+"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
env:
|
env:
|
||||||
REGISTRY: docker.frappet.com
|
REGISTRY: docker.frappet.com
|
||||||
IMAGE_NAME: ehr/bma-ehr-checkin
|
IMAGE_NAME: ehr/bma-ehr-checkin
|
||||||
DEPLOY_HOST: 49.0.91.80
|
DEPLOY_HOST: frappet.com
|
||||||
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
|
|
||||||
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-checkin
|
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-checkin
|
||||||
|
|
||||||
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:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
@ -67,21 +67,40 @@ jobs:
|
||||||
docker compose pull
|
docker compose pull
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
- name: Notify Discord Success
|
||||||
if: success()
|
if: success()
|
||||||
with:
|
run: |
|
||||||
access_token: ${{ secrets.TOKEN_LINE }}
|
curl -H "Content-Type: application/json" \
|
||||||
message: |
|
-X POST \
|
||||||
-Success✅✅✅
|
-d '{
|
||||||
Image: ${{env.IMAGE_NAME}}
|
"embeds": [{
|
||||||
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
"title": "✅ Deployment Success!",
|
||||||
By: ${{github.actor}}
|
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
"color": 3066993,
|
||||||
|
"footer": {
|
||||||
|
"text": "Release Notification",
|
||||||
|
"icon_url": "https://example.com/success-icon.png"
|
||||||
|
},
|
||||||
|
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||||
|
}]
|
||||||
|
}' \
|
||||||
|
${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
||||||
|
- name: Notify Discord Failure
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
run: |
|
||||||
access_token: ${{ secrets.TOKEN_LINE }}
|
curl -H "Content-Type: application/json" \
|
||||||
message: |
|
-X POST \
|
||||||
-Failure❌❌❌
|
-d '{
|
||||||
Image: ${{env.IMAGE_NAME}}
|
"embeds": [{
|
||||||
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
"title": "❌ Deployment Failed!",
|
||||||
By: ${{github.actor}}
|
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
|
||||||
|
"color": 15158332,
|
||||||
|
"footer": {
|
||||||
|
"text": "Release Notification",
|
||||||
|
"icon_url": "https://example.com/failure-icon.png"
|
||||||
|
},
|
||||||
|
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||||
|
}]
|
||||||
|
}' \
|
||||||
|
${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue