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 1e47dc5 commit 1e54a5a
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,29 @@ name: Deploy to PythonAnywhere
on:
push:
branches:
- master # Or the branch you want to deploy from
- master # Adjust this if your default branch is named differently

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:
PA_USERNAME: ${{ secrets.PA_USERNAME }}
PA_PASSWORD: ${{ secrets.PA_PASSWORD }}
run: |
curl -u $PA_USERNAME:$PA_PASSWORD \
-X POST \
-d "command=python manage.py migrate" \
https://www.pythonanywhere.com/api/v0/user/$PA_USERNAME/webapps/GuruTechDev.pythonanywhere.com/reload/
- 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:
PA_API_KEY: ${{ secrets.PA_API_KEY }}
run: |
curl -X POST "https://www.pythonanywhere.com/api/v0/user/<your-username>/webapps/<your-app-name>/reload/" \
-H "Authorization: Token $PA_API_KEY"

0 comments on commit 1e54a5a

Please sign in to comment.