From 1e54a5a0b49027595b26888ef49bce5b7e35b780 Mon Sep 17 00:00:00 2001 From: MANIKANDAN <161131016+Mani121800@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:34:20 +0530 Subject: [PATCH] Update ci-cd.yml --- .github/workflows/ci-cd.yml | 45 +++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 7ab8d49..d568265 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -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//webapps//reload/" \ + -H "Authorization: Token $PA_API_KEY"