From 5dac51f640e6e1f4a09d7c62564b7c36a44f83f4 Mon Sep 17 00:00:00 2001 From: ahmedgamalyousef Date: Thu, 9 Oct 2025 23:57:55 +0300 Subject: [PATCH] Updating Files --- .ghaymah.json | 2 +- README.md | 115 +++++++++++++++++++++++++++++--------------------- 2 files changed, 67 insertions(+), 50 deletions(-) diff --git a/.ghaymah.json b/.ghaymah.json index bbbfbd8..1b42f1f 100644 --- a/.ghaymah.json +++ b/.ghaymah.json @@ -1,6 +1,6 @@ { "id": "9071e5c5-d122-463c-93d9-86ec7622b39e", - "name": "bin", + "name": "Complete-CICD-Workflow-of-WeatheApp", "projectId": "811b5e36-3b8b-486a-81af-bef0f1980187", "ports": [ { diff --git a/README.md b/README.md index 49e19e6..8514532 100644 --- a/README.md +++ b/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 @@ -14,24 +11,22 @@ This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cl - ๐Ÿ“Š Auto-updating with timestamp - ๐ŸŽจ Responsive and modern UI (HTML, CSS, JS embedded in Flask) - ๐Ÿณ Dockerized for portability -- โ˜๏ธ CI/CD ready with Ghaymah Cloud +- โ˜๏ธ CI/CD ready with Ghaymah Cloud ---- ## ๐Ÿ“‚ Project Structure ``` . -โ”œโ”€โ”€ app.py # Flask application with weather API integration -โ”œโ”€โ”€ CICDpipeline.sh # CI/CD pipeline script for Docker + Ghaymah Cloud -โ”œโ”€โ”€ Dockerfile # Dockerfile to containerize the Flask app -โ”œโ”€โ”€ requirements.txt # Python dependencies -โ”œโ”€โ”€ templates/ # HTML templates (auto-generated by Dockerfile) -โ””โ”€โ”€ README.md # Documentation +โ”œโ”€โ”€ .github/workflows/cicd.yaml # GitHub Actions CI/CD workflow for my App +โ”œโ”€โ”€ app.py # Flask application with weather API integration +โ”œโ”€โ”€ CICDpipeline.sh # CI/CD pipeline script for Docker + Ghaymah Cloud +โ”œโ”€โ”€ Dockerfile # Dockerfile to containerize the Flask app +โ”œโ”€โ”€ requirements.txt # Python dependencies +โ”œโ”€โ”€ templates/ # HTML templates (auto-generated by Dockerfile) +โ””โ”€โ”€ README.md # Documentation ``` ---- - ## โš™๏ธ Prerequisites 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 - 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 1. Clone this repository: @@ -75,7 +123,7 @@ Before running or deploying the app, ensure you have: 5. Open your browser at: ๐Ÿ‘‰ http://127.0.0.1:5000 ---- + ## ๐Ÿณ Running with Docker @@ -94,9 +142,9 @@ Before running or deploying the app, ensure you have: 3. Visit the app at: ๐Ÿ‘‰ 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: - Builds and tags Docker images @@ -132,35 +180,4 @@ https://.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" -} -``` - ---- -