-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (38 loc) · 1.12 KB
/
main.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
name: Deploy to Alibaba ECS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# - name: Copy files to Alibaba ECS
# run: |
# ssh-keyscan -H ${{ secrets.ECS_HOST }} >> ~/.ssh/known_hosts
# scp -r ./* ${{ secrets.ECS_USER }}@${{ secrets.ECS_HOST }}:${{ secrets.ECS_PATH }}
- name: SSH to Alibaba ECS & pull GIT
run: |
ssh-keyscan -H ${{ secrets.ECS_HOST }} >> ~/.ssh/known_hosts
ssh ${{ secrets.ECS_USER }}@${{ secrets.ECS_HOST }} << 'EOF'
cd ${{ secrets.ECS_PATH }}
git pull origin main
EOF
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Re-install dependencies
run: npm install
# - name: Build App
# run: npm run build
- name: Install PM2
run: npm install -g pm2
- name: Restart App
run: pm2 restart artistica-api