-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) 路 1.29 KB
/
Copy pathDeployFront.yml
File metadata and controls
44 lines (37 loc) 路 1.29 KB
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
name: Deploy Frontend
on:
push:
branches: [ "develop" ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Notify Discord - Deploy Started
if: always()
run: |
curl -H "Content-Type: application/json" \
-d "{\"content\": \"馃殌 **Frontend Deploy Started**\nRepository: $GITHUB_REPOSITORY\nCommit: $GITHUB_SHA\"}" \
${{ secrets.DISCORD_WEBHOOK }}
- name: Deploy to EC2
id: deploy_script
uses: appleboy/ssh-action@v0.1.10
with:
host: githubaquarium.store
username: ubuntu
key: ${{ secrets.EC2_SSH_KEY }}
script: |
~/deploy_front.sh
- name: Notify Discord - Deploy Success
if: success()
run: |
curl -H "Content-Type: application/json" \
-d "{\"content\": \"馃煝 **Frontend Deploy Success!**\nRepository: $GITHUB_REPOSITORY\nCommit: $GITHUB_SHA\"}" \
${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord - Deploy Failed
if: failure()
run: |
curl -H "Content-Type: application/json" \
-d "{\"content\": \"馃敶 **Frontend Deploy FAILED**\nRepository: $GITHUB_REPOSITORY\nCommit: $GITHUB_SHA\nCheck GitHub Actions logs!\"}" \
${{ secrets.DISCORD_WEBHOOK }}