diff --git a/.github/workflows/deploy-prod.yaml b/.github/workflows/deploy-prod.yaml index ea90c60..1c48ce7 100644 --- a/.github/workflows/deploy-prod.yaml +++ b/.github/workflows/deploy-prod.yaml @@ -116,21 +116,16 @@ jobs: docker push ghcr.io/${{ github.repository_owner }}/pesu-auth:${{ steps.vars.outputs.tag }} docker push ghcr.io/${{ github.repository_owner }}/pesu-auth:latest - # Deploy to both Production and Staging - deploy-prod-and-staging: + # Deploy to Staging + deploy-to-staging: runs-on: ubuntu-latest needs: [sync-dev-to-main, push-to-dockerhub, push-to-ghcr] if: ${{ contains(fromJson(vars.PROD_DEPLOYMENT_ALLOWED_USERS), github.actor) }} env: - RENDER_DEPLOY_HOOK_URL_PROD: ${{ secrets.RENDER_DEPLOY_HOOK_URL_PROD }} RENDER_DEPLOY_HOOK_URL_DEV: ${{ secrets.RENDER_DEPLOY_HOOK_URL_DEV }} steps: - - name: Check Deploy Hook URLs + - name: Check Staging Deploy Hook URL run: | - if [ -z "${{ secrets.RENDER_DEPLOY_HOOK_URL_PROD }}" ]; then - echo "❌ Production deploy hook missing!" - exit 1 - fi if [ -z "${{ secrets.RENDER_DEPLOY_HOOK_URL_DEV }}" ]; then echo "❌ Staging deploy hook missing!" exit 1 @@ -145,6 +140,21 @@ jobs: } echo "✅ Staging deployment completed successfully!" + # Deploy to Production + deploy-to-prod: + runs-on: ubuntu-latest + needs: [sync-dev-to-main, push-to-dockerhub, push-to-ghcr, deploy-to-staging] + if: ${{ contains(fromJson(vars.PROD_DEPLOYMENT_ALLOWED_USERS), github.actor) }} + env: + RENDER_DEPLOY_HOOK_URL_PROD: ${{ secrets.RENDER_DEPLOY_HOOK_URL_PROD }} + steps: + - name: Check Production Deploy Hook URL + run: | + if [ -z "${{ secrets.RENDER_DEPLOY_HOOK_URL_PROD }}" ]; then + echo "❌ Production deploy hook missing!" + exit 1 + fi + - name: Deploy to Production run: | echo "🚀 Deploying to Production..."