File tree Expand file tree Collapse file tree 4 files changed +27
-19
lines changed Expand file tree Collapse file tree 4 files changed +27
-19
lines changed Original file line number Diff line number Diff line change 1-
21name : Deploy to PythonAnywhere
32
43on :
@@ -12,10 +11,11 @@ jobs:
1211 uses : actions/checkout@v4
1312
1413 - name : Redeploy to PythonAnywhere
15- uses : MiguelRizzi/pythonanywhere-deploy-ssh@v1
14+ uses : MiguelRizzi/pythonanywhere-deploy-ssh@v1.0.0
1615 with :
17- username : ${{ secrets.PA_USERNAME }}
18- password : ${{ secrets.PA_PASSWORD }}
19- working_directory : ${{ secrets.PA_WORKING_DIRECTORY }}
20- venv_directory : ${{ secrets.PA_VENV_DIRECTORY }}
21- wsgi_file : /var/www/webapp_name_wsgi.py
16+ ssh_host : ssh.eu.pythonanywhere.com # Optional - defaults to ssh.pythonanywhere.com
17+ username : ${{ secrets.PA_USERNAME }} # Your PythonAnywhere username
18+ password : ${{ secrets.PA_PASSWORD }} # Your PythonAnywhere password
19+ working_directory : ${{ secrets.PA_WORKING_DIRECTORY }} # Target working directory on PythonAnywhere
20+ venv_directory : ${{ secrets.PA_VENV_DIRECTORY }} # Path to your virtual environment
21+ wsgi_file : /var/www/webapp_name_wsgi.py # Path to your WSGI file
Original file line number Diff line number Diff line change 3434 uses : actions/checkout@v4
3535
3636 - name : Redeploy to PythonAnywhere
37- uses : MiguelRizzi/pythonanywhere-deploy-ssh@v1
37+ uses : MiguelRizzi/pythonanywhere-deploy-ssh@v1.0.0
3838 with :
39+ ssh_host : ssh.eu.pythonanywhere.com # Optional - defaults to ssh.pythonanywhere.com
3940 username : ${{ secrets.PA_USERNAME }}
4041 password : ${{ secrets.PA_PASSWORD }}
4142 working_directory : ${{ secrets.PA_WORKING_DIRECTORY }}
@@ -47,11 +48,12 @@ jobs:
4748
4849| Name | Description | Required | Example |
4950|-----------|-------------|----------|---------|
50- | username | Your PythonAnywhere username | ✅ | miguelrizzi |
51- | password | Your PythonAnywhere password | ✅ | password |
52- | working_directory | Target working directory on PythonAnywhere | ✅ | /home/username/webapp_name |
53- | venv_directory | Path to the Python virtual environment | ✅ | /home/username/webapp_name/.venv |
54- | wsgi_file | Path to the WSGI file to reload the app | ✅ | /var/www/webapp_name_wsgi.py |
51+ | ssh_host | Optional SSH host for PythonAnywhere (default: ssh.pythonanywhere.com) | No | ssh.eu.pythonanywhere.com |
52+ | username | Your PythonAnywhere username | Yes | miguelrizzi |
53+ | password | Your PythonAnywhere password | Yes | password |
54+ | working_directory | Target working directory on PythonAnywhere | Yes | /home/username/webapp_name |
55+ | venv_directory | Path to the Python virtual environment | Yes | /home/username/webapp_name/.venv |
56+ | wsgi_file | Path to the WSGI file to reload the app | Yes | /var/www/webapp_name_wsgi.py |
5557
5658
5759## 🔐 Security
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ branding:
77 color : blue
88
99inputs :
10+ ssh_host :
11+ description : " SSH host for PythonAnywhere (default: ssh.pythonanywhere.com)"
12+ required : false
13+ default : " ssh.pythonanywhere.com"
1014 username :
1115 description : " Your PythonAnywhere username"
1216 required : true
2731 using : docker
2832 image : Dockerfile
2933 args :
34+ - ${{ inputs.ssh_host }}
3035 - ${{ inputs.username }}
3136 - ${{ inputs.password }}
3237 - ${{ inputs.working_directory }}
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- USERNAME=$1
5- PASSWORD=$2
6- WORKING_DIRECTORY=$3
7- VENV_DIRECTORY=$4
8- WSGI_FILE=$5
4+ SSH_HOST=$1
5+ USERNAME=$2
6+ PASSWORD=$3
7+ WORKING_DIRECTORY=$4
8+ VENV_DIRECTORY=$5
9+ WSGI_FILE=$6
910
1011echo " Connecting to PythonAnywhere server..."
1112
12- sshpass -p " $PASSWORD " ssh -o StrictHostKeyChecking=no " $USERNAME @ssh.pythonanywhere.com " << EOF
13+ sshpass -p " $PASSWORD " ssh -o StrictHostKeyChecking=no " $USERNAME @$SSH_HOST " << EOF
1314 echo "Changing to working directory..."
1415 cd "$WORKING_DIRECTORY "
1516 echo "Activating virtual environment..."
You can’t perform that action at this time.
0 commit comments