Q3
هذا الالتزام موجود في:
50
q3-cicd/workflow.yml
Normal file
50
q3-cicd/workflow.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Ghaymah CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build -f q1-deploy-monitor/Dockerfile -t ghaymah-sre-api:${{ github.sha }} .
|
||||
|
||||
- name: Login to Ghaymah Registry
|
||||
run: |
|
||||
echo "${{ secrets.GHAYMAH_TOKEN }}" | docker login registry.ghaymah.systems \
|
||||
-u "${{ secrets.GHAYMAH_USERNAME }}" \
|
||||
--password-stdin
|
||||
|
||||
- name: Push Docker Image
|
||||
run: |
|
||||
docker tag ghaymah-sre-api:${{ github.sha }} registry.ghaymah.systems/${{ secrets.GHAYMAH_USERNAME }}/ghaymah-sre-api:${{ github.sha }}
|
||||
docker push registry.ghaymah.systems/${{ secrets.GHAYMAH_USERNAME }}/ghaymah-sre-api:${{ github.sha }}
|
||||
|
||||
deploy-staging:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment: staging
|
||||
|
||||
steps:
|
||||
- name: Deploy to Staging
|
||||
run: |
|
||||
echo "Deploying to staging..."
|
||||
|
||||
deploy-production:
|
||||
needs: deploy-staging
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: production
|
||||
|
||||
steps:
|
||||
- name: Deploy to Production
|
||||
run: |
|
||||
echo "Deploying to production..."
|
||||
المرجع في مشكلة جديدة
حظر مستخدم