Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
XSmas29 authored Jul 10, 2024
1 parent 150c678 commit b2b1003
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,28 @@ jobs:
# 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@v3
uses: actions/setup-node@v4
with:
node-version: 20

- name: SSH and deploy
- name: Pull GIT changes
run: |
ssh-keyscan -H ${{ secrets.ECS_HOST }} >> ~/.ssh/known_hosts
ssh ${{ secrets.ECS_USER }}@${{ secrets.ECS_HOST }} << 'EOF'
cd ${{ secrets.ECS_PATH }}
# Pull latest changes
git pull origin main
# Install dependencies
nvm use 20
npm install
# Build the project
npm run build
# Restart the application
pm2 restart artistica-api
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

0 comments on commit b2b1003

Please sign in to comment.