Skip to content

Commit

Permalink
[TM-1519] Enable a pattern to control which services are deployed in …
Browse files Browse the repository at this point in the history
…which envs.
  • Loading branch information
roguenet committed Dec 2, 2024
1 parent a842f21 commit 1ecf67c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/deploy-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,42 @@ permissions:
contents: read

jobs:
check-services:
runs-on: ubuntu-latest
environment: ${{ inputs.env }}
outputs:
job-service-enabled: ${{ steps.check-services.outputs.job }}
user-service-enabled: ${{ steps.check-services.outputs.user }}
research-service-enabled: ${{ steps.check-services.outputs.research }}
steps:
- id: check-services
run: |
echo "job=${{ vars.ENABLED_SERVICES == '' || contains(vars.ENABLED_SERVICES, 'job-service') }}" >> "$GITHUB_OUTPUT"
echo "user=${{ vars.ENABLED_SERVICES == '' || contains(vars.ENABLED_SERVICES, 'user-service') }}" >> "$GITHUB_OUTPUT"
echo "research=${{ vars.ENABLED_SERVICES == '' || contains(vars.ENABLED_SERVICES, 'research-service') }}" >> "$GITHUB_OUTPUT"
job-service:
needs: check-services
if: needs.check-services.outputs.job-service-enabled == 'true'
uses: ./.github/workflows/deploy-service.yml
with:
env: ${{ inputs.env }}
service: job-service
secrets: inherit


user-service:
needs: check-services
if: needs.check-services.outputs.user-service-enabled == 'true'
uses: ./.github/workflows/deploy-service.yml
with:
env: ${{ inputs.env }}
service: user-service
secrets: inherit

research-service:
needs: check-services
if: needs.check-services.outputs.research-service-enabled == 'true'
uses: ./.github/workflows/deploy-service.yml
with:
env: ${{ inputs.env }}
Expand Down

0 comments on commit 1ecf67c

Please sign in to comment.