-
Notifications
You must be signed in to change notification settings - Fork 25
56 lines (53 loc) · 2.01 KB
/
deployed.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: 🚀 Deploy website on push
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
web-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 📂 Sync Files
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASS }}
port: ${{ secrets.SSH_PORT }}
script: cd /home/kodingke/shortkeun.xyz && git pull origin main
- name: ♻️ Restart Server...
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASS }}
port: ${{ secrets.SSH_PORT }}
script: cd /home/kodingke/shortkeun.xyz && touch tmp/restart.txt
- name: ✅ Telegram Notification Success
uses: appleboy/telegram-action@master
if: ${{ success() }}
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
✅ `berhasil` *${{ github.actor }}* trigger deployment
📩 Commit message: *${{ github.event.commits[0].message }}*
🧑💻 Developer: *${{github.actor}}*
🔗 See changes: [CEK APP](https://github.com/${{ github.repository }}/commit/${{github.sha}})
format: markdown
disable_web_page_preview: "True"
- name: ❌ Telegram Notification Failed
uses: appleboy/telegram-action@master
if: ${{ failure() }}
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
❌ `gagal` *${{ github.actor }}* trigger deployment
📩 Commit message: *${{ github.event.commits[0].message }}*
🧑💻 Developer: *${{github.actor}}*
🔗 See changes: [CEK APP](https://github.com/${{ github.repository }}/commit/${{github.sha}})
format: markdown
disable_web_page_preview: "True"