Merge branch 'development' #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |