From f75e37fd0f7b9b7067b5e8eab68c54e5354e5385 Mon Sep 17 00:00:00 2001 From: boutmoun Date: Thu, 14 May 2026 15:08:41 +0000 Subject: [PATCH] =?UTF-8?q?=D8=AA=D8=AD=D8=AF=D9=8A=D8=AB=20.github/workfl?= =?UTF-8?q?ows/main.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 53 ++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 798c2ef..bb0df8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,14 +1,57 @@ +name: Docker Build And Push To Docker Hub + on: push: - pull_request: - -jobs: + branches: + - main - +jobs: deploy: steps: - name: checkout code uses: actions/checkout@v5.0.0 + + - name: Create .ghaymah.json with environment variables + run: | + # Read the existing .ghaymah.json or create base structure + if [ -f .ghaymah.json ]; then + cat .ghaymah.json > /tmp/ghaymah.json + else + echo '{ + "id": "a778f1cb-2075-4132-b91b-13d29f1b06e3", + "name": "saif-lp", + "projectId": "277f4c56-dfd7-4dff-81a2-7e7c28c763c3", + "ports": [ + { + "expose": true, + "number": 80 + } + ], + "publicAccess": { + "enabled": true, + "domain": "syriaaifoundation.org" + }, + "resourceTier": "t4", + "dockerFileName": "Dockerfile" + }' > /tmp/ghaymah.json + fi + + # Create env object with all secrets + jq '.env = { + "SMTP_CC": "${{ secrets.SMTP_CC }}", + "SMTP_FROM": "${{ secrets.SMTP_FROM }}", + "SMTP_HOST": "${{ secrets.SMTP_HOST }}", + "SMTP_PASS": "${{ secrets.SMTP_PASS }}", + "SMTP_PORT": "${{ secrets.SMTP_PORT }}", + "SMTP_TO": "${{ secrets.SMTP_TO }}", + "SMTP_USER": "${{ secrets.SMTP_USER }}", + "SUPABASE_SECRET_KEY": "${{ secrets.SUPABASE_SECRET_KEY }}", + "SUPABASE_SERVICE_ROLE_KEY": "${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}", + "SUPABASE_ANON_KEY": "${{ secrets.SUPABASE_ANON_KEY }}", + "SUPABASE_URL": "${{ secrets.SUPABASE_URL }}", + "PUBLIC_BUILD_SHA": "${{ github.sha }}" + }' /tmp/ghaymah.json > .ghaymah.json + - name: install ghaymah cli run: curl -sSl https://cli.ghaymah.systems/install.sh | bash @@ -16,4 +59,4 @@ jobs: run: $HOME/ghaymah/bin/gy auth login --email "${{secrets.GHAYMAH_EMAIL}}" --password "${{secrets.GHAYMAH_PW}}" - name: deploy - run: $HOME/ghaymah/bin/gy resource app launch \ No newline at end of file + run: $HOME/ghaymah/bin/gy resource app launch