Skip to content

Commit

Permalink
chore: Update .gitignore file to exclude the 'dist' directory and add…
Browse files Browse the repository at this point in the history
… 'dumpdata.json'
  • Loading branch information
devangspsingh committed Aug 3, 2024
1 parent 0366201 commit 247283b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy to Server

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Run deployment commands on server
run: |
ssh -o StrictHostKeyChecking=no [email protected] << 'EOF'
cd /home/ubuntu/gyanaangan-django
source /home/ubuntu/gyanaangan-django/venv/bin/activate # Activate virtual environment if needed
# Check if requirements.txt has changed and update dependencies
if [ -n "$(git diff origin/main HEAD -- requirements.txt)" ]; then
pip install -r requirements.txt
fi
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic --noinput
sudo systemctl restart gunicorn
sudo systemctl restart nginx
EOF
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Wallet/
instantclient_23_4/
# C extensions
*.so

dumpdata.json
# Distribution / packaging
.Python
build/
Expand Down

0 comments on commit 247283b

Please sign in to comment.