Deploy of all to tools by @johnrwatson #117
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Services | |
run-name: Deploy of ${{ inputs.service }} to ${{ inputs.environment }} by @${{ github.actor }} | |
on: | |
workflow_call: | |
inputs: | |
environment: | |
type: string | |
default: "tools" | |
service: | |
type: string | |
default: "all" | |
version: | |
type: string | |
default: "stable" | |
deploy-type: | |
type: string | |
default: "instance" | |
workflow_dispatch: | |
inputs: | |
environment: | |
type: choice | |
required: true | |
description: "Where to deploy" | |
default: "tools" | |
options: | |
- tools | |
- production | |
service: | |
type: choice | |
required: true | |
description: "service to deploy" | |
options: | |
- all | |
- pinga | |
- rebaser | |
- sdf | |
- veritech | |
- web | |
version: | |
type: string | |
required: true | |
description: "version to deploy" | |
default: "stable" | |
deploy-type: | |
type: choice | |
required: true | |
description: "deployment variant" | |
default: "instance" | |
options: | |
- binary | |
- instance | |
jobs: | |
set-init: | |
uses: ./.github/workflows/set-init-version.yml | |
with: | |
environment: ${{ inputs.environment }} | |
service: ${{ inputs.service }} | |
version: ${{ inputs.version }} | |
secrets: inherit | |
define-deployment-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
services: ${{ steps.services.outputs.services }} | |
steps: | |
- id: services | |
run: | | |
if [ "${{ inputs.service }}" = "all" ]; then | |
echo 'services=["pinga", "rebaser", "sdf", "veritech", "web"]' >> "$GITHUB_OUTPUT" | |
else | |
echo 'services=["${{ inputs.service }}"]' >> "$GITHUB_OUTPUT" | |
fi | |
deploy-services: | |
needs: "define-deployment-matrix" | |
strategy: | |
fail-fast: false | |
matrix: | |
service: ${{ fromJSON(needs.define-deployment-matrix.outputs.services) }} | |
uses: ./.github/workflows/deploy-service.yml | |
with: | |
environment: ${{ inputs.environment }} | |
service: ${{ matrix.service }} | |
version: ${{ inputs.version }} | |
deploy-type: ${{ inputs.deploy-type }} | |
secrets: inherit | |
e2e-validation: | |
# We want to ensure that in-progress cron runs against tools-prod | |
# are canceled when we do a deploy so they don't fail erroneously | |
concurrency: | |
group: e2e-${{ inputs.environment }} | |
cancel-in-progress: true | |
needs: deploy-services | |
uses: ./.github/workflows/e2e-validation.yml | |
with: | |
environment: ${{ inputs.environment }} | |
secrets: inherit |