Skip to content

Commit c305a02

Browse files
authored
Update pythonanywhere.yml
pushing and updating code to pythonanywhere
1 parent e24a3b8 commit c305a02

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
name: Automate PythonAnywhere Bash Shell
1+
name: Deploy to PythonAnywhere
22

33
on:
44
push:
55
branches:
66
- master
77

88
jobs:
9-
run_pythonanywhere:
9+
deploy:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Send Bash Command to PythonAnywhere
14-
run: |
15-
curl -s -X GET \
16-
"https://www.pythonanywhere.com/api/v0/user/${{ secrets.PA_USERNAME }}/webapps/" \
17-
-H "Authorization: Token ${{ secrets.PA_API_TOKEN }}" \
18-
-H "Content-Type: application/json"
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Update code on PythonAnywhere
17+
run: |
18+
curl -s -X POST \
19+
"https://www.pythonanywhere.com/api/v0/user/${{ secrets.PA_USERNAME }}/consoles/38366532/send_input/" \
20+
-H "Authorization: Token ${{ secrets.PA_API_TOKEN }}" \
21+
-d '{"input": "cd metro-fare-calculator && git pull origin main\n"}' \
22+
-H "Content-Type: application/json"
23+
1924

0 commit comments

Comments
 (0)