Closed davem-git closed 7 months ago
You can just override the OCI_CLI_REGION
environment variable for each step that calls configure-kubectl-oke
.
Thats not a great solution. That requires me to duplicate blocks of code. Where as I can setup a a matrix list of clusters, store the region with it and loop through them all in one block.
You could use a matrix for this as well by providing the matrix output to an env:
block within the step itself, which will override the job-level env
setting.
Could you provide a sample?
Something like this should work:
jobs:
example_matrix:
strategy:
matrix:
region: ["us-ashburn-1", "us-phoenix-1", "au-melbourne-1"]
steps:
- uses: oracle-actions/configure-kubectl-oke@v1.3.2
env:
OCI_CLI_REGION: ${{ matrix.region }}
I've left out some required fields just for brevity to show how the matrix values could be used. You'd want to combine this with your existing workflow.
that worked great. Might be worth adding it to the readme. This can be closed
How can this support multiple regions without copying and pasting the whole workflow?
can the region be added to be passed in as an input?