The Determine Deployment Environments action analyzes your repository configuration and determines which environments should be used for deployment. It returns a matrix of environments and their settings for use in deployment workflows.
Usage
- uses: microsoft/AL-Go/Actions/[email protected]
id: determine
with:
getEnvironments: '*'
type: 'CD'
shell
string
default:"powershell"
Shell in which you want to run the action (powershell or pwsh)
Specifies the pattern of the environments you want to retrieve
- Use
* for all environments
- Use specific environment names or patterns
Type of deployment:
CD - Continuous deployment
Publish - Publishing deployment
All - All deployment types
If true, allow deploying to environments that do not exist (will create a new GitHub environment)
Outputs
The Environment matrix to use for the Deploy step in compressed JSON format
DeploymentEnvironmentsJson
Deployment Environments with settings in compressed JSON format
Number of Deployment Environments found
Flag determining whether the environment is unknown
Flag determining whether to generate the ALDoc artifact
Flag determining whether to deploy the ALDoc artifact to GitHub Pages
Example Workflow
jobs:
determine:
runs-on: ubuntu-latest
outputs:
environmentsMatrixJson: ${{ steps.determine.outputs.EnvironmentsMatrixJson }}
deploymentEnvironmentsJson: ${{ steps.determine.outputs.DeploymentEnvironmentsJson }}
environmentCount: ${{ steps.determine.outputs.EnvironmentCount }}
steps:
- uses: actions/checkout@v4
- name: Determine Deployment Environments
id: determine
uses: microsoft/AL-Go/Actions/[email protected]
with:
getEnvironments: '*'
type: 'CD'
createEnvIfNotExists: 'false'
deploy:
needs: determine
if: needs.determine.outputs.environmentCount > 0
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.determine.outputs.environmentsMatrixJson) }}
steps:
- name: Deploy to ${{ matrix.environment }}
uses: microsoft/AL-Go/Actions/[email protected]
with:
environmentName: ${{ matrix.environment }}
deploymentEnvironmentsJson: ${{ needs.determine.outputs.deploymentEnvironmentsJson }}
This action is typically used at the beginning of a deployment workflow to determine which environments need to be deployed to.
When createEnvIfNotExists is set to true, new GitHub environments will be created automatically. Ensure this aligns with your security and governance policies.