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
10 changes: 5 additions & 5 deletions .github/workflows/deploy-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Deploy to Production
on:
workflow_dispatch:

env:
vars:
# Array of usernames allowed to trigger production deploys
ALLOWED_USERS: '["aditeyabaral", "achyu-dev", "ndigvijay"]'

jobs:
# Sync dev branch to main before deployment
sync-dev-to-main:
runs-on: ubuntu-latest
if: ${{ contains(fromJson(env.ALLOWED_USERS), github.actor) }}
if: ${{ contains(fromJson(vars.ALLOWED_USERS), github.actor) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
push-to-dockerhub:
runs-on: ubuntu-latest
needs: sync-dev-to-main
if: ${{ contains(fromJson(env.ALLOWED_USERS), github.actor) }}
if: ${{ contains(fromJson(vars.ALLOWED_USERS), github.actor) }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
push-to-ghcr:
runs-on: ubuntu-latest
needs: sync-dev-to-main
if: ${{ contains(fromJson(env.ALLOWED_USERS), github.actor) }}
if: ${{ contains(fromJson(vars.ALLOWED_USERS), github.actor) }}
permissions:
contents: read
packages: write
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
deploy-prod-and-staging:
runs-on: ubuntu-latest
needs: [sync-dev-to-main, push-to-dockerhub, push-to-ghcr]
if: ${{ contains(fromJson(env.ALLOWED_USERS), github.actor) }}
if: ${{ contains(fromJson(vars.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 }}
Expand Down
Loading