Skip to content

Commit

Permalink
feat: setup CICD for multiple node
Browse files Browse the repository at this point in the history
  • Loading branch information
daihiep-swe committed Aug 22, 2023
1 parent 507dca9 commit b190f84
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,56 @@ jobs:
*Commit message:* ${{ github.event.head_commit.message }}
*Commit url:* ${{ github.event.head_commit.url }}
*Commit author:* ${{ github.event.head_commit.author.name }}
ssh-to-ec2-2:
runs-on: ubuntu-22.04
needs: ssh-to-ec2
steps:
- name: SSH to EC2
uses: appleboy/ssh-action@master
id: ssh
with:
host: ${{ secrets.SSH_HOST_NODE_2 }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd cd-scripts/chainmart-be-batches
./deploy.sh
continue-on-error: true

- name: Send mesage to Telegram
if: steps.ssh.outcome == 'failure'
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: |
*SSH to EC2 failed!*
*Branch:* ${{ github.ref }}
*Workflow:* ${{ github.workflow }}
*Run number:* ${{ github.run_number }}
*Run id:* ${{ github.run_id }}
*Commit message:* ${{ github.event.head_commit.message }}
*Commit url:* ${{ github.event.head_commit.url }}
*Commit author:* ${{ github.event.head_commit.author.name }}
- name: Send mesage to Telegram
if: steps.ssh.outcome == 'success'
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: |
*SSH to EC2 success!*
*Branch:* ${{ github.ref }}
*Workflow:* ${{ github.workflow }}
*Run number:* ${{ github.run_number }}
*Run id:* ${{ github.run_id }}
*Commit message:* ${{ github.event.head_commit.message }}
*Commit url:* ${{ github.event.head_commit.url }}
*Commit author:* ${{ github.event.head_commit.author.name }}

0 comments on commit b190f84

Please sign in to comment.