Skip to content

Merge remote-tracking branch 'origin/main' #43

Merge remote-tracking branch 'origin/main'

Merge remote-tracking branch 'origin/main' #43

Workflow file for this run

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