|
1 | 1 | # 🚀 PythonAnywhere Redeploy Action
|
2 | 2 |
|
3 |
| -This GitHub Action automates the redeployment of a Django application hosted on **PythonAnywhere** via SSH. |
| 3 | +This GitHub Action automates the redeployment process of a Django application hosted on **PythonAnywhere** using SSH. |
| 4 | +It simplifies the workflow of pulling the latest code, installing dependencies, running migrations, and restarting the web server with minimal configuration. |
4 | 5 |
|
5 |
| -> ⚠️ **Important**: SSH access on PythonAnywhere is **only available for paid accounts**. This action will not work with free accounts. |
| 6 | + |
| 7 | +## ✅ Requirements |
| 8 | + |
| 9 | +Before using this action, make sure that: |
| 10 | + |
| 11 | +- You have a **paid PythonAnywhere account**, as SSH access is only available for paid plans. |
| 12 | +- SSH access is enabled on your PythonAnywhere account. |
| 13 | +- Your Django project is deployed on PythonAnywhere and cloned via Git. |
6 | 14 |
|
7 | 15 |
|
8 | 16 | ## 📦 What does this action do?
|
@@ -48,12 +56,12 @@ jobs:
|
48 | 56 |
|
49 | 57 | | Name | Description | Required | Example |
|
50 | 58 | |-----------|-------------|----------|---------|
|
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 | |
| 59 | +| `ssh_host` | Optional SSH host for PythonAnywhere (default: `ssh.pythonanywhere.com`) | No | `ssh.eu.pythonanywhere.com` | |
| 60 | +| `username` | Your PythonAnywhere username | Yes | `username` | |
| 61 | +| `password` | Your PythonAnywhere password | Yes | `password` | |
| 62 | +| `working_directory` | Target working directory on PythonAnywhere | Yes | `/home/username/webapp_name` | |
| 63 | +| `venv_directory` | Path to the Python virtual environment | Yes | `/home/username/webapp_name/.venv` | |
| 64 | +| `wsgi_file` | Path to the WSGI file to reload the app | Yes | `/var/www/webapp_name_wsgi.py` | |
57 | 65 |
|
58 | 66 |
|
59 | 67 | ## 🔐 Security
|
@@ -86,6 +94,9 @@ Main script executed inside the container. It uses `sshpass` to connect to Pytho
|
86 | 94 | - `Dockerfile`
|
87 | 95 | Defines a custom Docker image based on `ubuntu`, installs `sshpass`, and copies the required scripts. This ensures the environment has all necessary tools to perform the redeploy process without relying on the host runner.
|
88 | 96 |
|
| 97 | +- `.github/workflows/example.yml` |
| 98 | +Provides an example of how to use the action in a workflow. You can use it as a template or reference when setting up your own deployment workflow. |
| 99 | + |
89 | 100 |
|
90 | 101 | ## 📝 License
|
91 | 102 |
|
|
0 commit comments