-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (24 loc) · 979 Bytes
/
ci-cd.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
name: Deploy to GitHub Pages and Oracle Compute Instance
on:
push:
branches:
- main # Trigger deployment on pushes to the main branch
jobs:
deploy-backend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: SSH to Oracle Instance and Deploy Backend
uses: appleboy/[email protected]
with:
host: ${{ secrets.ORACLE_HOST }} # Your Oracle Instance IP
username: ${{ secrets.Oracle_USER }} # Your Oracle username
key: ${{ secrets.Oracle_SSH_KEY }} # Your SSH private key
script: |
export NODE_ENV=production
cd /home/opc/InstagramTool # Adjust the path to your backend
git pull origin main # Pull the latest changes
cd Backend
npm install # Install only production dependencies
pm2 restart nodejs-server # Restart your Node.js app with PM2