welcome ghaymah
هذا الالتزام موجود في:
14
q3-cicd/README.md
Normal file
14
q3-cicd/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# --- Q3 Theoretical Documentation ---
|
||||
|
||||
## 1. Difference Between Staging and Production Environments:
|
||||
- **Staging Environment:** A pre-production, isolated environment identical to production, used exclusively for testing updates, running integration tests, and catching bugs safely before real users see them.
|
||||
- **Production Environment:** The live, primary environment accessed by end-users, where stability, high availability, and security are critical.
|
||||
|
||||
## 2. Ghaymah CLI Integration & Connection:
|
||||
To link and authenticate with Ghaymah CLI locally or in pipelines:
|
||||
1. Install the CLI tool:
|
||||
`curl -sL https://cli.ghaymah.systems/install.sh | bash`
|
||||
2. Authenticate using your API token:
|
||||
`ghaymah auth login --token <YOUR_API_TOKEN>`
|
||||
3. Verify connection status:
|
||||
`ghaymah cluster status`
|
||||
55
q3-cicd/workflow.yml
Normal file
55
q3-cicd/workflow.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
name: CI/CD Pipeline to Ghaymah
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Ghaymah Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: registry.ghaymah.systems
|
||||
username: ${{ secrets.GHAYMAH_USERNAME }}
|
||||
password: ${{ secrets.GHAYMAH_TOKEN }}
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: registry.ghaymah.systems/abdulrahman/deploy-monitor:latest
|
||||
|
||||
staging-deploy:
|
||||
needs: build-and-push
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to Staging Environment
|
||||
run: |
|
||||
echo "Deploying the built image to Staging server for testing..."
|
||||
# ghaymah CLI command example for staging
|
||||
|
||||
production-approval:
|
||||
needs: staging-deploy
|
||||
runs-on: ubuntu-latest
|
||||
environment: production # This triggers the GitHub Manual Approval gate
|
||||
steps:
|
||||
- name: Approved for Production
|
||||
run: echo "Manual approval passed. Proceeding to production deployment."
|
||||
|
||||
production-deploy:
|
||||
needs: production-approval
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to Production
|
||||
run: |
|
||||
echo "Deploying application to live Production server..."
|
||||
# ghaymah CLI command example for production
|
||||
|
||||
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم