You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+147Lines changed: 147 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,153 @@ Metro Fare Calculator is a simple web application designed to help users calcula
6
6
7
7
The application is built using the Django framework and is designed to be responsive and easy to use. Users simply select their starting station and ending station from a dropdown menu, and the application calculates the fare based on the distance between the two stations.
8
8
9
+
I have created CI/CD pipelines to automatically deploy code updates on Github repository to pythonanywhere web application.
10
+
11
+
Automating Code Deployment from GitHub to PythonAnywhere
12
+
13
+
Overview
14
+
15
+
This document provides a step-by-step guide to automatically deploy code updates from a GitHub repository to a PythonAnywhere web application using GitHub Actions and the PythonAnywhere API.
16
+
17
+
1. Prerequisites
18
+
19
+
Before setting up automation, ensure you have:
20
+
21
+
A PythonAnywhere account (Free or Paid)
22
+
23
+
A GitHub repository with your project
24
+
25
+
API access enabled on PythonAnywhere (for Free users)
26
+
27
+
A web app running on PythonAnywhere
28
+
29
+
2. Enable API Access on PythonAnywhere
30
+
31
+
To use the PythonAnywhere API:
32
+
33
+
Go to PythonAnywhere Account Settings
34
+
35
+
Scroll to API Token and click "Create API Token" (if not already created).
36
+
37
+
Copy the API Token, as it will be needed later.
38
+
39
+
3. Clone Your GitHub Repository on PythonAnywhere
40
+
41
+
Open the Bash console on PythonAnywhere.
42
+
43
+
Run the following command to clone your repository:
Ensure the API token is correctly added in GitHub Secrets.
143
+
144
+
Changes not reflecting
145
+
146
+
Verify git pull works in the PythonAnywhere console.
147
+
148
+
Console ID issue
149
+
150
+
Use API to list active consoles and find the correct console_id.
151
+
152
+
Conclusion
153
+
154
+
This guide helps automate deployment from GitHub to PythonAnywhere using API calls. Once set up, every push to GitHub updates the PythonAnywhere project automatically and reloads the web app. 🚀
155
+
9
156

0 commit comments