From 9cbd6a43aed577cd4d6c28d3998a2b978659dc7b Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Jul 2026 01:09:46 +0000 Subject: [PATCH] Edit workflow --- .gitea/workflows/ci.yaml | 68 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 75ecabf..9efef32 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -1,16 +1,19 @@ -name: Ghaymah CI/CD +name: Ghaymah CI/CD Pipeline on: push: branches: - main +env: + IMAGE_NAME: mohamedsaleh33/ghaymah-sre-api:v2 + jobs: - build-and-push: + build: runs-on: ubuntu-latest steps: - - name: Checkout source code + - name: Checkout Repository uses: actions/checkout@v4 - name: Login to Docker Hub @@ -22,9 +25,62 @@ jobs: - name: Build Docker Image run: | docker build \ - -f q1-deploy-monitor/Dockerfile \ - -t mohamedsaleh33/ghaymah-sre-api:v2 . + -f q1-deploy-monitor/Dockerfile \ + -t $IMAGE_NAME . - name: Push Docker Image run: | - docker push mohamedsaleh33/ghaymah-sre-api:v2 + docker push $IMAGE_NAME + + deploy-staging: + needs: build + runs-on: ubuntu-latest + environment: + name: staging + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Ghaymah CLI + run: | + curl -sSl https://cli.ghaymah.systems/install.sh | bash + + - name: Login to Ghaymah + env: + GHAYMAH_EMAIL: ${{ secrets.GHAYMAH_EMAIL }} + GHAYMAH_PASSWORD: ${{ secrets.GHAYMAH_PASSWORD }} + run: | + printf "%s\n%s\n" "$GHAYMAH_EMAIL" "$GHAYMAH_PASSWORD" | /root/ghaymah/bin/gy auth login + + - name: Deploy to Staging + run: | + /root/ghaymah/bin/gy resource app launch + + deploy-production: + needs: deploy-staging + runs-on: ubuntu-latest + environment: + name: production + + steps: + - name: Manual Approval + run: echo "Waiting for production approval..." + + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Ghaymah CLI + run: | + curl -sSl https://cli.ghaymah.systems/install.sh | bash + + - name: Login to Ghaymah + env: + GHAYMAH_EMAIL: ${{ secrets.GHAYMAH_EMAIL }} + GHAYMAH_PASSWORD: ${{ secrets.GHAYMAH_PASSWORD }} + run: | + printf "%s\n%s\n" "$GHAYMAH_EMAIL" "$GHAYMAH_PASSWORD" | /root/ghaymah/bin/gy auth login + + - name: Deploy to Production + run: | + /root/ghaymah/bin/gy resource app launch