forked from doubaniux/boofilsic
-
-
Notifications
You must be signed in to change notification settings - Fork 34
41 lines (38 loc) · 1.21 KB
/
preview-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: Preview Deployment
on:
workflow_run:
workflows: ["Development Image"]
types:
- completed
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deployment:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: deployment to preview environment
runs-on: ubuntu-latest
environment: ${{ vars.DEPLOY_ENV }}
steps:
- name: Send start notification
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
color: "#6848a9"
message: Deployment ${{ github.ref_name }} started
- name: ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
script: ${{ vars.DEPLOY_SCRIPT }}
- name: Send complete notification
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
color: "#6848a9"
message: Deployment ${{ github.ref_name }} complete