Skip to main content
The CI/CD workflow is the core automation pipeline in AL-Go for GitHub. It builds, tests, and deploys your Business Central applications automatically whenever changes are pushed to your repository.

Overview

The CI/CD workflow runs automatically on:
  • Push events to main, release/*, or feature/* branches (excluding markdown files and most workflow files)
  • Manual trigger via workflow_dispatch
This workflow handles the complete lifecycle of your AL applications, from building and testing to deploying to environments and delivering artifacts to external targets.

Workflow Jobs

1

Initialization

The workflow starts by initializing settings, determining which projects to build, and identifying deployment targets.Key Actions:
  • Reads AL-Go settings and secrets
  • Determines projects to build based on dependencies
  • Identifies deployment environments
  • Configures delivery targets (NuGet, Storage, etc.)
  • Sets up telemetry scope
2

Check for Updates

Verifies if updates to AL-Go system files are available.This job runs in parallel with the build and checks whether your repository’s AL-Go system files (in .AL-Go and .github folders) are up to date with the template repository.
If updates are available, you’ll see a notification in the workflow output. Use the Update AL-Go System Files workflow to apply updates.
3

Build

Compiles all AL projects in the repository.Build Process:
  • Runs on a matrix of projects and build modes
  • Compiles apps and test apps
  • Runs tests and collects results
  • Performs code analysis
  • Signs artifacts (if configured)
  • Uses artifact cache for performance
  • Validates against baseline (previous builds)
Each project is built according to the build order determined by project dependencies.
4

Build PowerPlatform (PTE only)

For Per-Tenant Extension repositories with PowerPlatform solutions, this job builds the PowerPlatform solution.
This job only runs if powerPlatformSolutionFolder is configured in your repository settings.
5

Code Analysis Upload

Processes AL code analysis results and uploads them to GitHub Security.Features:
  • Downloads error logs from build artifacts
  • Converts AL compiler warnings/errors to SARIF format
  • Uploads to GitHub Code Scanning for visibility
Code analysis results appear in the Security tab of your repository when trackALAlertsInGitHub is enabled.
6

Deploy Reference Documentation

Builds and deploys AL reference documentation to GitHub Pages (if configured).This job:
  • Generates documentation from AL code comments
  • Builds a static site
  • Deploys to GitHub Pages
Only runs on the main branch when generateALDocArtifact is enabled in settings.
7

Deploy

Deploys built artifacts to Business Central and PowerPlatform environments.Deployment Strategy:
  • Runs for all configured CD (Continuous Deployment) environments
  • Uses environment-specific authentication contexts
  • Deploys apps in dependency order
  • Supports both Business Central and PowerPlatform deployments
Environments must be configured in GitHub repository settings and have the appropriate authentication secrets.
8

Deliver

Delivers artifacts to external delivery targets.Supported Targets:
  • NuGet package repositories
  • Azure Storage
  • Custom delivery targets
Artifacts are delivered only if delivery target contexts are configured in repository secrets.
9

Post-Process

Finalizes the workflow and reports telemetry.This job always runs (even if previous jobs fail) to ensure proper cleanup and reporting.

Configuration

Required Secrets

License File

Secret: licenseFileUrlURL to your Business Central license file for compilation.

Code Signing

Secrets: codeSignCertificateUrl, codeSignCertificatePasswordCertificate for signing app artifacts.

Environment Auth

Secret: {EnvironmentName}-AuthContext or {EnvironmentName}_AuthContextAuthentication context for deployment environments.

Delivery Targets

Secrets: nuGetContext, storageContextAuthentication for external delivery targets.

Settings

Key settings in .github/AL-Go-Settings.json:
{
  "type": "PTE",
  "templateUrl": "https://github.com/microsoft/AL-Go-PTE@main",
  "environments": [
    "QA",
    "PROD"
  ],
  "deliveryTargets": [
    {
      "deliveryTarget": "NuGet",
      "projectsFilter": "*"
    }
  ],
  "trackALAlertsInGitHub": true,
  "generateALDocArtifact": 1
}

Workflow Triggers

Automatic Triggers

The workflow runs automatically on push events:
on:
  push:
    paths-ignore:
      - '**.md'
      - '.github/workflows/*.yaml'
      - '!.github/workflows/CICD.yaml'
    branches: [ 'main', 'release/*', 'feature/*' ]
Markdown files and workflow changes (except CICD.yaml itself) are ignored to prevent unnecessary builds.

Manual Trigger

Trigger manually from GitHub Actions:
  1. Go to Actions tab
  2. Select CI/CD workflow
  3. Click Run workflow
  4. Select the branch and click Run workflow

Build Matrix

The workflow supports building multiple projects with different configurations:
  • Projects: All AL projects in the repository
  • Build Modes: Default, Clean, Translated (based on configuration)
  • Runners: Windows or Linux (configurable per project)
The build matrix is dynamically generated based on project dependencies and repository settings.

Deployment Process

Environment Configuration

1

Create GitHub Environment

In your repository settings, create a new environment (e.g., “QA”, “PROD”).
2

Add to AL-Go Settings

Add the environment name to .github/AL-Go-Settings.json:
{
  "environments": ["QA", "PROD"]
}
3

Configure Authentication

Add an environment or repository secret with the authentication context:
  • Secret name: QA-AuthContext or QA_AuthContext
  • Secret value: JSON authentication context
{
  "tenantId": "your-tenant-id",
  "clientId": "your-client-id",
  "clientSecret": "your-client-secret",
  "scopes": "https://api.businesscentral.dynamics.com/.default"
}

Artifacts

The workflow produces several types of artifacts:

Apps

Compiled .app files ready for deployment.

Test Apps

Test application packages with test codeunits.

Build Output

Compilation logs and build information.

Test Results

JUnit XML test results and coverage reports.

Error Logs and Code Analysis

When trackALAlertsInGitHub is enabled:
  1. Compiler warnings and errors are collected during build
  2. SARIF file is generated with all issues
  3. Code Scanning alerts appear in the Security tab
  4. Pull requests show inline annotations for issues
Code scanning requires the security-events: write permission, which is automatically granted in the workflow.

Performance Optimization

Artifact Cache

The workflow uses artifact caching to speed up builds:
  • Dependencies are cached between builds
  • Baseline artifacts from previous builds are reused
  • App symbols are cached for faster compilation

Workflow Depth

Control build depth with the workflowDepth setting:
env:
  workflowDepth: 1
  • 1: Build only changed projects
  • Higher values: Build dependent projects up to N levels deep

Troubleshooting

Build Failures

Check the build job logs for compilation errors. Ensure all dependencies are available and license file is configured.

Deployment Failures

Verify authentication context secrets are correct and the environment is accessible. Check environment-specific logs.

Missing Updates

If update notifications appear, run the Update AL-Go System Files workflow to sync with the latest template.

Code Analysis Issues

Review the Security tab for detailed code analysis results. Configure code cops in app.json to adjust analysis rules.

Example Workflow Run

A typical CI/CD workflow execution:
  1. Developer pushes code to main branch
  2. Workflow triggers automatically
  3. Projects are determined based on changes and dependencies
  4. Build runs in parallel for all projects
  5. Tests execute and results are collected
  6. Code analysis processes warnings and errors
  7. Artifacts deploy to QA environment automatically
  8. Delivery sends packages to NuGet
  9. Workflow completes with status report
The entire process typically completes in 5-15 minutes depending on project size and complexity.

Build docs developers (and LLMs) love