الملفات
ghaymah-exam-Abdulrahman-Ab…/q3-cicd/workflow.yml
2026-07-27 23:06:16 +03:00

56 أسطر
1.4 KiB
YAML

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