Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created May 31, 2023 21:03
Show Gist options
  • Select an option

  • Save KyMidd/709ca861d665c3d4772c9309fc4b2eae to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/709ca861d665c3d4772c9309fc4b2eae to your computer and use it in GitHub Desktop.
jobs:
gather-info:
name: Gather information
runs-on: ubuntu-latest
# Set outputs for orchestration job
outputs:
MAX_PARALLEL: ${{ steps.set-deploy-strategy.outputs.MAX_PARALLEL }}
TARGETED_PODS: ${{ steps.set-targeted-pods.outputs.TARGETED_PODS }}
steps:
- uses: actions/checkout@v3
- name: Set Concurrency to ${{ github.event.inputs.concurrency == 'concurrent' && 100 || 1 }}
id: set-deploy-strategy
run: |
# If strategy is concurrent, max parallel is set to 100 (arbitrarily high number)
if [[ ${{ github.event.inputs.concurrency }} == "concurrent" ]]; then
echo "Concurrent deployment strategy selected, max parallel set to 100"
echo "MAX_PARALLEL=100" >> $GITHUB_OUTPUT
# If strategy is sequential, max parallel is set to 1
elif [[ ${{ github.event.inputs.concurrency }} == "sequential" ]]; then
echo "Concurrent deployment strategy selected, max parallel set to 100"
echo "MAX_PARALLEL=1" >> $GITHUB_OUTPUT
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment