File tree Expand file tree Collapse file tree 1 file changed +9
-31
lines changed Expand file tree Collapse file tree 1 file changed +9
-31
lines changed Original file line number Diff line number Diff line change 6
6
7
7
jobs :
8
8
deploy :
9
+ name : deploy
9
10
runs-on : ubuntu-latest
10
11
steps :
11
- - name : Git Checkout
12
- uses : actions/checkout@v4
13
-
14
- - name : Install pnpm
15
- uses : pnpm/action-setup@v4
16
- with :
17
- version : 8.15.6
18
-
19
- - name : Use Node.js
20
- uses : actions/setup-node@v4
21
- with :
22
- node-version : " 20.x"
23
- cache : " pnpm"
24
-
25
- - name : Install dependencies
26
- run : pnpm install
27
-
28
- - name : Configure SSH
29
- uses : webfactory/ssh-agent@v0.8.0
30
- with :
31
- ssh-private-key : ${{ secrets.AWS_PRIVATE_KEY }}
32
-
33
12
- name : Deploy to EC2
34
- env :
35
- AWS_REGION : ${{ secrets.AWS_REGION }}
36
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
37
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
38
- AWS_EC2_HOST : ${{ secrets.AWS_EC2_HOST }}
39
- AWS_EC2_USER : ${{ secrets.AWS_EC2_USER }}
40
- run : |
41
- ssh -o StrictHostKeyChecking=no "$AWS_EC2_USER@$AWS_EC2_HOST" << 'EOF'
13
+ uses : appleboy/ssh-action@v1.2.2
14
+ with :
15
+ host : ${{ secrets.AWS_EC2_HOST }}
16
+ username : ${{ secrets.AWS_EC2_USER }}
17
+ key : ${{ secrets.AWS_PRIVATE_KEY }}
18
+ port : ${{secrets.SERVER_PORT }}
19
+ script-stop : true
20
+ script : |
42
21
cd /home/ubuntu/codeit-resources
43
22
git pull origin develop
44
23
pnpm install
45
24
pnpm --filter=api build
46
25
pm2 restart codeit-server
47
- EOF
You can’t perform that action at this time.
0 commit comments