Skip to main content
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'

Inputs

shell
string
default:"powershell"
Shell in which you want to run the action (powershell or pwsh)
getEnvironments
string
required
Specifies the pattern of the environments you want to retrieve
  • Use * for all environments
  • Use specific environment names or patterns
type
string
required
Type of deployment:
  • CD - Continuous deployment
  • Publish - Publishing deployment
  • All - All deployment types
createEnvIfNotExists
boolean
default:"false"
If true, allow deploying to environments that do not exist (will create a new GitHub environment)

Outputs

EnvironmentsMatrixJson
string
The Environment matrix to use for the Deploy step in compressed JSON format
DeploymentEnvironmentsJson
string
Deployment Environments with settings in compressed JSON format
EnvironmentCount
number
Number of Deployment Environments found
UnknownEnvironment
boolean
Flag determining whether the environment is unknown
GenerateALDocArtifact
boolean
Flag determining whether to generate the ALDoc artifact
DeployALDocArtifact
boolean
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.

Build docs developers (and LLMs) love