Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/_deploy-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
deploy:
name: Deploy
runs-on: ubuntu-24.04
environment: ${{ inputs.azure_environment == 'prod' && 'production' || 'staging' }}
environment: ${{ github.event_name != 'pull_request' && (inputs.azure_environment == 'prod' && 'production' || 'staging') || '' }}
env:
UNIQUE_PREFIX: ${{ vars.UNIQUE_PREFIX }}
ENVIRONMENT: ${{ inputs.azure_environment }}
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/_deploy-infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,20 @@ jobs:
plan:
name: Plan
runs-on: ubuntu-24.04
outputs:
should_deploy: ${{ steps.determine_deployment.outputs.should_deploy }}
steps:
- name: Determine Deployment Conditions # For production: only deploy from main branch, but for staging also deploy from pull requests with 'Deploy to Staging' label
id: determine_deployment
run: |
if [[ "${{ inputs.azure_environment }}" == "prod" && "${{ github.ref }}" == "refs/heads/main" ]]; then
should_deploy="true"
elif [[ "${{ inputs.azure_environment }}" == "stage" && ("${{ github.ref }}" == "refs/heads/main" || "${{ contains(github.event.pull_request.labels.*.name, 'Deploy to Staging') }}" == "true") ]]; then
should_deploy="true"
else
should_deploy="false"
fi
echo "should_deploy=$should_deploy" >> $GITHUB_OUTPUT
- name: Checkout Code
uses: actions/checkout@v4

Expand All @@ -69,9 +82,9 @@ jobs:

deploy:
name: Deploy
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ needs.plan.outputs.should_deploy == 'true' }}
needs: plan
environment: ${{ inputs.azure_environment == 'prod' && 'production' || 'staging' }}
environment: ${{ github.event_name != 'pull_request' && (inputs.azure_environment == 'prod' && 'production' || 'staging') || '' }}
runs-on: ubuntu-24.04

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cloud-infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permissions:
jobs:
stage:
name: Staging
if: ${{ github.ref == 'refs/heads/main' && vars.STAGING_CLUSTER_ENABLED == 'true' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Deploy to Staging')) }}
if: ${{ vars.STAGING_CLUSTER_ENABLED == 'true' }}
uses: ./.github/workflows/_deploy-infrastructure.yml
secrets: inherit
with:
Expand Down
Loading