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 97ceef5
Showing 1 changed file with 53 additions and 19 deletions.
72 changes: 53 additions & 19 deletions .github/workflows/deploy-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,59 @@ permissions:
contents: read

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

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

0 comments on commit 97ceef5

Please sign in to comment.