-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (39 loc) · 1.73 KB
/
deploy.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
name: Deploy Bot
# Only runs after PRs have been merged into master
on:
workflow_dispatch:
pull_request:
types: [closed]
branches:
- master
jobs:
deploy:
name: Deploy Bot
runs-on: 'ubuntu-latest'
environment: production
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
steps:
- name: SSH Remote Commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: cd /srv/crowbartools-discord-bot/ && git reset --hard origin/master && git pull && npm install && npm run build && pm2 restart discord-bot
- name: Discord Webhook Action
uses: tsickert/[email protected]
if: ${{ success() }}
with:
webhook-url: ${{ secrets.DISCORD_GIT_WEBHOOK_URL }}
embed-title: "[crowbartools/crowbartools-discord-bot] Deployed to Production"
embed-url: "https://github.com/crowbartools/crowbartools-discord-bot/deployments"
embed-color: 5763719
- name: Discord Webhook Action
uses: tsickert/[email protected]
if: ${{ failure() }}
with:
webhook-url: ${{ secrets.DISCORD_GIT_WEBHOOK_URL }}
embed-title: "[crowbartools/crowbartools-discord-bot] Deployment Failed"
embed-url: "https://github.com/crowbartools/crowbartools-discord-bot/deployments"
embed-color: 15548997