File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed
Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Deploy to EC2 (cfde-liver-main)
2+
3+ on :
4+ push :
5+ branches :
6+ - cfde-liver-main
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : read
11+
12+ concurrency :
13+ group : deploy-ec2-cfde-liver-main
14+ cancel-in-progress : true
15+
16+ jobs :
17+ build-and-deploy :
18+ runs-on : ubuntu-latest
19+ timeout-minutes : 30
20+
21+ steps :
22+ - name : Checkout
23+ uses : actions/checkout@v4
24+
25+ - name : Setup Node
26+ uses : actions/setup-node@v4
27+ with :
28+ node-version : 18
29+ cache : npm
30+
31+ - name : Install dependencies
32+ run : npm ci
33+
34+ - name : Build production assets
35+ run : npm run deploy
36+
37+ - name : Deploy dist to EC2
38+ uses : appleboy/scp-action@v0.1.7
39+ with :
40+ host : ${{ secrets.EC2_HOST_CFDE_LIVER }}
41+ username : ${{ secrets.EC2_USER_CFDE_LIVER }}
42+ key : ${{ secrets.EC2_SSH_KEY_CFDE_LIVER }}
43+ port : ${{ secrets.EC2_PORT || 22 }}
44+ source : dist/*
45+ target : ${{ secrets.EC2_TARGET_DIR_CFDE_LIVER }}
46+ strip_components : 1
47+
48+ - name : Run post-deploy script
49+ uses : appleboy/ssh-action@v1.0.3
50+ with :
51+ host : ${{ secrets.EC2_HOST_CFDE_LIVER }}
52+ username : ${{ secrets.EC2_USER_CFDE_LIVER }}
53+ key : ${{ secrets.EC2_SSH_KEY_CFDE_LIVER }}
54+ port : ${{ secrets.EC2_PORT || 22 }}
55+ script : /opt/deploy/post-deploy.sh
You can’t perform that action at this time.
0 commit comments