-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update .gitignore file to exclude the 'dist' directory and add…
… 'dumpdata.json'
- Loading branch information
1 parent
0366201
commit 247283b
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
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
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 |
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