Skip to content

Commit

Permalink
Update ci-cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Mani121800 authored Aug 7, 2024
1 parent f443151 commit 0459582
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ name: Deploy to PythonAnywhere
on:
push:
branches:
- master # Adjust this to your main branch if it's different
- master # Or the branch you want to deploy from

jobs:
deploy:
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10' # Specify your Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Deploy to PythonAnywhere
env:
PYTHONANYWHERE_USERNAME: ${{ secrets.GuruTechDev}}
PYTHONANYWHERE_PASSWORD: ${{ secrets.gurudev@123 }}
PA_USERNAME: ${{ secrets.PA_USERNAME }}
PA_PASSWORD: ${{ secrets.PA_PASSWORD }}
run: |
curl -u $PYTHONANYWHERE_USERNAME:$PYTHONANYWHERE_PASSWORD \
curl -u $PA_USERNAME:$PA_PASSWORD \
-X POST \
-F "file=@deploy.sh" \
https://www.pythonanywhere.com/api/v0/user/$.GuruTechDev/webapps/GuruTechDev.pythonanywhere.com/reload/
-d "command=python manage.py migrate" \
https://www.pythonanywhere.com/api/v0/user/$PA_USERNAME/webapps/yourappname/reload/

0 comments on commit 0459582

Please sign in to comment.