-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1 KB
/
ci-cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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"