Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions .github/workflows/deploy-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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..."
Expand Down