[improve web vitals]: Update background image URLs in templates to us… #16
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 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 | |
git pull origin main # Pull the latest changes from the repository | |
source /home/ubuntu/gyanaangan-django/venv/bin/activate # Activate virtual environment if needed | |
pip install -r requirements.txt | |
python manage.py migrate | |
python manage.py collectstatic --noinput | |
sudo systemctl restart gunicorn | |
sudo systemctl restart nginx | |
EOF |