https://github.com/umuttopalak/pythonanywhere-deploy-action
A GitHub Action for automating CI/CD processes on a specified server. This action changes directories, activates virtual environments, updates git repositories, installs dependencies, runs database migrations, and reloads web applications.
https://github.com/umuttopalak/pythonanywhere-deploy-action
deployment django github-actions github-workflows pythonanywhere
Last synced: about 1 month ago
JSON representation
A GitHub Action for automating CI/CD processes on a specified server. This action changes directories, activates virtual environments, updates git repositories, installs dependencies, runs database migrations, and reloads web applications.
- Host: GitHub
- URL: https://github.com/umuttopalak/pythonanywhere-deploy-action
- Owner: umuttopalak
- License: mit
- Created: 2024-03-28T23:20:43.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-13T07:12:11.000Z (4 months ago)
- Last Synced: 2025-01-13T08:21:12.062Z (4 months ago)
- Topics: deployment, django, github-actions, github-workflows, pythonanywhere
- Language: JavaScript
- Homepage:
- Size: 443 KB
- Stars: 21
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# pythonanywhere-deploy-action
GitHub action to reload a Django Backend webapp on pythonanywhere. The service pythonanywhere can host web apps based on Python (i.e. Django, Flask, ...). The web app can be updated by copying files to the server with various technologies (i.e. Git, SSH, ...) but afterwards the web app has to be restarted manually. Otherwise the web app is not updated.In order to enable a continuous deployment to pythonanywhere, this GitHub action automatically updates your pythonanywhere web app with the help of their API.
# Note
The pythonanywhere API is currently in beta state. Because of that it is possible that the action might not work anymore after a change in the API interface.# Usage
```yaml
- name: Re-Deploy Pythonanywhere Django API
uses: umuttopalak/[email protected]
with:
host:
username:
api_token:
domain_name:
```## Get API token
In order to get the API token you haveLogin into your pythonanywhere account.
Navigate to Account.
Click on section API token.
Generate an API token and save it.
Do not directly paste your api token or other sensitive data in your workflow xml. Create GitHub action secrets and reference those secrets in your workflow xml.# Example
```yaml
name: Deploy pythonanywhere webapp
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2- name: Re-Deploy Pythonanywhere Django API
uses: umuttopalak/[email protected]
with:
host: 'www.pythonanywhere.com' or 'www.eu.pythonanywhere.com'
username: {{ secrets.USERNAME }}
api_token: {{ secrets.API_TOKEN }}
domain_name: {{ secrets.DOMAIN_NAME }}
```# License
MIT: See *LICENSE* for detailed license information.