Skip to content

Update ci-cd.yml

Update ci-cd.yml #29

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Upload files to PythonAnywhere
env:
SSH_PRIVATE_KEY: ${{ secrets.demo }}
run: |
echo "$SSH_PRIVATE_KEY" > private_key
chmod 600 private_key
rsync -avz -e "ssh -i private_key -o StrictHostKeyChecking=no" ./ GuruTechDev@ssh.pythonanywhere.com:/home/GuruTechDev/hosting/
- name: Reload PythonAnywhere Web App
env:
PYTHONANYWHERE_API_TOKEN: ${{ secrets.demo }}
run: |
curl -s -X POST https://www.pythonanywhere.com/api/v0/user/GuruTechDev/webapps/GuruTechDev/reload/ \
-H "Authorization: Token $PYTHONANYWHERE_API_TOKEN"