Update .release-please-manifest.json #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy main branch | |
on: | |
push: | |
branches: | |
- main | |
env: | |
CI: true | |
SSH_PORT: 22 | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
send-noti-on-start: | |
runs-on: ubuntu-latest | |
name: Send noti to telegram on | |
steps: | |
- name: Send Telegram Message | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_RECEIVER }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: html | |
message: | | |
π | |
Start deploy <b>Nested Notation</b> to production | |
Commit message β¨: ${{ github.event.head_commit.message}} | |
Commited by π: <b>${{ github.event.head_commit.author.name}}</b> | |
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} | |
π | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
with: | |
token: ${{ secrets.RELEASE_TOKEN }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: send-noti-on-start | |
continue-on-error: true | |
steps: | |
- name: Pull code and restart pm2 | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST_PRO }} | |
username: ${{ secrets.SSH_USERNAME_PROD }} | |
port: 22 | |
password: ${{ secrets.SSH_PASSWORD_PRO }} | |
script: | | |
whoami | |
pwd | |
cd nestednotation | |
git reset --hard | |
git pull origin main | |
npm install | |
pm2 start ecosystem.config.js -f --env production | |
send-noti-on-complete: | |
runs-on: ubuntu-latest | |
needs: deploy | |
steps: | |
- name: Send Telegram Message | |
# if: success() | |
if: ${{ needs.deploy.result == 'success' }} | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_RECEIVER }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: html | |
message: | | |
β | |
Deploy <b>Nested Notation</b> to production successfully | |
See changes: ${{ github.event.head_commit.message}} | |
Deployed by: <b>${{ github.event.head_commit.author.name}}</b> | |
β | |
- name: Send Telegram Message | |
if: ${{ needs.deploy.result == 'failure' }} | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_RECEIVER }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: html | |
message: | | |
β | |
Deploy Nested Notation to Prod failed | |
Deployed by: <b>${{ github.event.head_commit.author.name}}</b> | |
See changes: ${{ github.event.head_commit.message}} | |
Error Details: ${{ github.action_status.message }} | |
β | |