Skip to content

add explanation to modify, + other things #5

add explanation to modify, + other things

add explanation to modify, + other things #5

Workflow file for this run

name: Deploy to EC2
on:
push:
branches: [main]
paths:
- "backend/**" # Only trigger on backend changes
- ".github/workflows/**"
jobs:
deploy:
runs-on: ubuntu-latest
# Add concurrency to prevent multiple deployments running at once
concurrency:
group: production
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Deploy to EC2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ubuntu
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd ~/gitdiagram
git fetch origin main
git reset --hard origin/main # Force local to match remote main
chmod +x ./backend/deploy.sh # Make the script executable
./backend/deploy.sh