-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 1.01 KB
/
Copy pathdeploy.yml
File metadata and controls
34 lines (29 loc) · 1.01 KB
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
name: Deploy to EC2
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: SSH and Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }} # Your Elastic IP
username: ubuntu
key: ${{ secrets.SSH_PRIVATE_KEY }} # Your .pem file content
script: |
cd ~/MCPforEXP
git fetch origin main
git reset --hard origin/main # Discard local server changes (like .pico-engine)
echo "PICO_ENGINE_BASE_URL=${{ secrets.PICO_ENGINE_BASE_URL }}" > .env
echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" >> .env
echo "AWS_REGION=us-east-2" >> .env
echo "NODE_ENV=production" >> .env
echo "PORT=3001" >> .env
npm install
# Restart only what changed to minimize downtime for your 30,000 users
pm2 restart proxy
pm2 restart ui