Updating Files
نجحت جميع الفحوصات
/ build_and_push_image (push) Successful in 21s
/ deploy (push) Successful in 11s

هذا الالتزام موجود في:
ahmedgamalyousef
2025-10-09 23:57:55 +03:00
الأصل be8081b92f
التزام 5dac51f640
2 ملفات معدلة مع 67 إضافات و50 حذوفات

عرض الملف

@@ -1,6 +1,6 @@
{ {
"id": "9071e5c5-d122-463c-93d9-86ec7622b39e", "id": "9071e5c5-d122-463c-93d9-86ec7622b39e",
"name": "bin", "name": "Complete-CICD-Workflow-of-WeatheApp",
"projectId": "811b5e36-3b8b-486a-81af-bef0f1980187", "projectId": "811b5e36-3b8b-486a-81af-bef0f1980187",
"ports": [ "ports": [
{ {

115
README.md
عرض الملف

@@ -1,10 +1,7 @@
# 🌤️ Weather Forecast App # 🌤️ Complete GitHub Actions CI/CD Weather Forecast App on Ghaymah Cloud
A simple yet modern **Flask-based weather forecast application** that fetches real-time weather data from [OpenWeatherMap](https://openweathermap.org/) and provides a beautiful, responsive UI. A simple modern **Flask-based weather forecast application** that fetches real-time weather data from [OpenWeatherMap](https://openweathermap.org/) and provides a beautiful, responsive UI. This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cloud** using the included shell script.
This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cloud** using the included shell script.
---
## 🚀 Features ## 🚀 Features
@@ -14,24 +11,22 @@ This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cl
- 📊 Auto-updating with timestamp - 📊 Auto-updating with timestamp
- 🎨 Responsive and modern UI (HTML, CSS, JS embedded in Flask) - 🎨 Responsive and modern UI (HTML, CSS, JS embedded in Flask)
- 🐳 Dockerized for portability - 🐳 Dockerized for portability
- ☁️ CI/CD ready with Ghaymah Cloud - ☁️ CI/CD ready with Ghaymah Cloud
---
## 📂 Project Structure ## 📂 Project Structure
``` ```
. .
├── app.py # Flask application with weather API integration ├── .github/workflows/cicd.yaml # GitHub Actions CI/CD workflow for my App
├── CICDpipeline.sh # CI/CD pipeline script for Docker + Ghaymah Cloud ├── app.py # Flask application with weather API integration
├── Dockerfile # Dockerfile to containerize the Flask app ├── CICDpipeline.sh # CI/CD pipeline script for Docker + Ghaymah Cloud
├── requirements.txt # Python dependencies ├── Dockerfile # Dockerfile to containerize the Flask app
├── templates/ # HTML templates (auto-generated by Dockerfile) ├── requirements.txt # Python dependencies
── README.md # Documentation ── templates/ # HTML templates (auto-generated by Dockerfile)
└── README.md # Documentation
``` ```
---
## ⚙️ Prerequisites ## ⚙️ Prerequisites
Before running or deploying the app, ensure you have: Before running or deploying the app, ensure you have:
@@ -41,8 +36,61 @@ Before running or deploying the app, ensure you have:
- [Ghaymah CLI (`gy`)](https://docs.ghaymah.io) installed and configured - [Ghaymah CLI (`gy`)](https://docs.ghaymah.io) installed and configured
- An [OpenWeatherMap API key](https://home.openweathermap.org/api_keys) - An [OpenWeatherMap API key](https://home.openweathermap.org/api_keys)
## 🖥️ On Your Terminal
1. **Install Ghaymah CLI**
```bash
curl -sSl https://cli.ghaymah.systems/install.sh | bash
```
2. **Navigate to Ghaymah Binary Directory & Create Project Files**
```bash
cd /ghaymah/bin
```
Create the following files:
- `Dockerfile`
- `index.html`
3. **Set Project Name**
```bash
gy r c p --set .name="project name"
```
4. **Initialize Project with Your Ghaymah Project ID**
```bash
gy r a init -p project-id
```
5. **Copy Configuration File**
- Copy the generated `.ghaymah.json` file to your repository.
## 🌩️ On Your GitPasha Account
1. **Add Repository Secrets**
- `DOCKERHUB_USERNAME`
- `DOCKERHUB_PASSWORD`
- `GHAYMAH_EMAIL`
- `GHAYMAH_PASSWORD`
2. **Push Your Repository**
```bash
git add .
git commit -m "Initial commit for Ghaymah deployment"
git push origin main
```
--- ---
✅ **Now your project is ready for automatic deployment via Ghaymah Cloud!**
## 🛠️ Local Development ## 🛠️ Local Development
1. Clone this repository: 1. Clone this repository:
@@ -75,7 +123,7 @@ Before running or deploying the app, ensure you have:
5. Open your browser at: 5. Open your browser at:
👉 http://127.0.0.1:5000 👉 http://127.0.0.1:5000
---
## 🐳 Running with Docker ## 🐳 Running with Docker
@@ -94,9 +142,9 @@ Before running or deploying the app, ensure you have:
3. Visit the app at: 3. Visit the app at:
👉 http://localhost:5000 👉 http://localhost:5000
---
## ☁️ CI/CD Deployment to Ghaymah Cloud
# ☁️ Deployment to Ghaymah Cloud uisng **CICDpipeline.sh** Script
This project includes a **CICDpipeline.sh** script that: This project includes a **CICDpipeline.sh** script that:
- Builds and tags Docker images - Builds and tags Docker images
@@ -132,35 +180,4 @@ https://<your-app-name>.hosted.ghaymah.systems
--- ---
## 🧾 Environment Variables
Set your OpenWeatherMap API key (recommended):
```bash
export API_KEY="your_openweathermap_api_key"
```
If not set, a demo key will be used (limited requests).
---
## 📊 Health Check
Check if the app is running:
```bash
curl http://localhost:5000/health
```
Example response:
```json
{
"status": "healthy",
"timestamp": "2025-09-25T14:30:00"
}
```
---