51 أسطر
2.3 KiB
Markdown
51 أسطر
2.3 KiB
Markdown
# Question 3: Ghaymah CI/CD Pipeline & Deployment Strategy
|
|
|
|
## 1. GitHub Actions Workflow Description
|
|
The workflow defined in `.github/workflows/deploy.yml` automates the entire software delivery lifecycle:
|
|
- Builds a Docker image upon push to `main` or `staging` branches.
|
|
- Authenticates with **Ghaymah Container Registry** (`registry.ghaymah.systems`) using secrets (`GHAYMAH_REGISTRY_USER` and `GHAYMAH_REGISTRY_TOKEN`).
|
|
- Pushes image tags mapped to the specific Git commit SHA and `:latest`.
|
|
|
|
---
|
|
|
|
## 2. Manual Approval Before Production Deployment
|
|
Manual gate approval is implemented using GitHub Actions **Environments**:
|
|
- The `deploy-production` job targets `environment: production`.
|
|
- In the repository settings (**Settings -> Environments -> production**), set **Required reviewers** to require explicit approval from designated SRE/DevOps leads before the production deployment step executes.
|
|
|
|
---
|
|
|
|
## 3. Difference Between Staging and Production Environments
|
|
|
|
| Feature / Aspect | Staging Environment | Production Environment |
|
|
| :--- | :--- | :--- |
|
|
| **Purpose** | Internal testing, QA, and validation before release. | Live system serving real end-users. |
|
|
| **Data Usage** | Mock data or anonymized database snapshots. | Live real customer data with strict isolation. |
|
|
| **Traffic & Scale** | Low, simulated testing traffic. | Real-world peak traffic (scales dynamically). |
|
|
| **Deployment Trigger**| Automatic on push to `staging` branch. | Gated deployment requiring manual approval on `main` branch. |
|
|
| **Uptime / SLA** | Non-critical (brief downtimes allowed). | High availability (99.99% uptime required). |
|
|
|
|
---
|
|
|
|
## 4. Ghaymah CLI Integration & Documentation
|
|
|
|
To interface with Ghaymah Cloud programmatically via the `ghaymah` CLI tool, follow these steps:
|
|
|
|
### A. Installation & Authentication:
|
|
```bash
|
|
# Install Ghaymah CLI tool
|
|
curl -sSL [https://cli.ghaymah.systems/install.sh](https://cli.ghaymah.systems/install.sh) | bash
|
|
|
|
# Authenticate with Ghaymah account API key
|
|
ghaymah auth login --api-key ${{ secrets.GHAYMAH_API_KEY }}
|
|
B. Deploying App via Ghaymah CLI:
|
|
Bash
|
|
# Set active project context
|
|
ghaymah config set project 280878eb-1999-4c79-9f7a-5fboea17ca25
|
|
|
|
# Trigger application deployment
|
|
ghaymah app deploy \
|
|
--app-id 09ae0d6b-h8dc-455a-b109-530ab3752f6b \
|
|
--image registry.ghaymah.systems/admin/q1-deploy-monitor:latest \
|
|
--env production
|