-
Notifications
You must be signed in to change notification settings - Fork 2
28 lines (26 loc) · 850 Bytes
/
main.yml
File metadata and controls
28 lines (26 loc) · 850 Bytes
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
name: Deploy to PythonAnywhere
on:
push:
branches:
- main # Or your default branch
jobs:
update-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create tarball of frontend files
run: |
mkdir -p temp_frontend
shopt -s extglob
cp -R !(temp_frontend) temp_frontend/ || true
tar -czf frontend.tar.gz -C temp_frontend .
- name: Upload files to PythonAnywhere
env:
PA_TOKEN: ${{ secrets.PYTHONANYWHERE_API_TOKEN }}
PA_USER: ${{ secrets.PYTHONANYWHERE_USERNAME }}
run: |
curl -X POST \
-H "Authorization: Token $PA_TOKEN" \
-F "content=@frontend.tar.gz" \
https://www.pythonanywhere.com/api/v0/user/$PA_USER/files/path/home/$PA_USER/mysite/frontend/RPG/frontend.tar.gz