-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.74 KB
/
deploy-trunk.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
name: Happy Prime Production Deployment
on:
push:
branches: [ trunk ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Deploy to server
if: success()
uses: easingthemes/ssh-deploy@v4
env:
SSH_PRIVATE_KEY: ${{ secrets.KINSTA_SSH_KEY }}
ARGS: "-rltgoDzvO --exclude-from=.deploy_ignore --delete"
SOURCE: "./"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
TARGET: ${{ secrets.REMOTE_TARGET }}
- name: Successful deployment Slack notification
if: success()
uses: wearerequired/slack-messaging-action@v2
with:
bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
channel: project-happyprimeweb
payload: >-
{
"icon_emoji": ":shipit:",
"username": "Happy Prime Deployment: ${{ github.event.sender.login }}",
"text": ":white_check_mark: Deployment from the <https://github.com/${{ github.repository }}|${{ github.repository }}> `trunk` branch to https://happyprime.co complete."
}
- name: Deployment failed Slack notification
if: failure()
uses: wearerequired/slack-messaging-action@v2
with:
bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
channel: project-happyprimeweb
payload: >-
{
"icon_emoji": ":shipit:",
"username": "Happy Prime Deployment: ${{ github.event.sender.login }}",
"text": ":large_red_square: Deployment from the <https://github.com/${{ github.repository }}|${{ github.repository }}> `trunk` branch to https://happyprime.co failed."
}