Skip to content

Commit

Permalink
feat: add GitHub Actions workflow for server deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedSobhy01 committed Dec 21, 2024
1 parent 074bd17 commit f1a5f7e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to Server

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Deploy to Server
env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
ssh -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST << 'EOF'
cd /var/www/jobesta
sudo git reset --hard origin/main
sudo git pull origin main --force
cp server/.env server/.env.example
cp client/.env client/.env.example
sudo docker-compose up -d --build
EOF

0 comments on commit f1a5f7e

Please sign in to comment.