-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 2 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
52
53
54
55
56
# This file is managed in https://github.com/happyprime/projects
name: Production deployment from trunk
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/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.REMOTE_SSH_PRIVATE_KEY }}
ARGS: "-rltgoDzvO --include-from=.deploy_include --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@v3
with:
bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
channel: ${{ secrets.SLACK_CHANNEL }}
payload: >-
{
"icon_emoji": ":shipit:",
"unfurl_links": false,
"unfurl_media": false,
"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 ${{ secrets.PRODUCTION_URL }} complete."
}
- name: Deployment failed Slack notification
if: failure()
uses: wearerequired/slack-messaging-action@v3
with:
bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
channel: project-happyprimeweb
payload: >-
{
"icon_emoji": ":shipit:",
"unfurl_links": false,
"unfurl_media": false,
"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 ${{ secrets.PRODUCTION_URL }} failed."
}