Skip to content

Update main.yml

Update main.yml #8

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
run: |
ssh-keyscan -H ${{ secrets.ECS_HOST }} >> ~/.ssh/known_hosts
ssh ${{ secrets.ECS_USER }}@${{ secrets.ECS_HOST }} << 'EOF'
EOF
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Pull GIT changes
run: |
cd ${{ secrets.ECS_PATH }}
git pull origin main
EOF
- name: Re-install dependencies
run: npm install
- name: Build App
run: npm run build
- name: Restart App
run: pm2 restart artistica-api