Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created May 7, 2023 19:29
Show Gist options
  • Select an option

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

Select an option

Save KyMidd/a6343152294e4ee20262afea72c94708 to your computer and use it in GitHub Desktop.
name: Test passing matrix
on:
- workflow_dispatch
jobs:
set-environment:
runs-on: ubuntu-latest
outputs:
ENVIRONMENT: ${{ steps.set-environment-task.outputs.ENVIRONMENT }}
steps:
- uses: actions/checkout@v3
- name: Define deploy locations
id: set-environment-task
run: |
env1="'env1'"
env2="'env2'"
env3="'env3'"
echo "ENVIRONMENT=[$env1, $env2, $env3]" >> $GITHUB_OUTPUT
batch-deploy:
needs: set-environment
runs-on: ubuntu-latest
strategy:
matrix:
environment: ${{ fromJSON(needs.set-environment.outputs.ENVIRONMENT) }}
steps:
- name: Deploy to environment
run: echo "hi mom"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment