Using AL-Go with GitHub to Simplify CI/CD for Business Central
Introduction
In today’s fast-moving world of software development, Continuous Integration (CI) and Continuous Deployment (CD) are key to building and releasing updates quickly and reliably.
For Business Central developers, AL-Go for GitHub makes this process easy by using GitHub Actions to automate builds, testing, and deployments.
It comes with ready-to-use templates that help you set up a complete CI/CD pipeline in minutes so you can focus more on coding and less on managing workflows.
Each build typically takes around 20 minutes when using containers, which fits comfortably within GitHub’s free limits for most projects 2,000 minutes per month for private repositories on the Free tier, 3,000 minutes on the Team tier, and up to 50,000 minutes on the Enterprise tier.
Since public repositories get unlimited free minutes, AL-Go for GitHub offers an affordable and powerful way to maintain professional DevOps practices without extra costs.
Overall, it’s a simple, cost-efficient, and developer-friendly solution to keep your Business Central environments up to date and running smoothly.
References
Al-Go ReadMe
AL Go - Overview
GitHub - Pricing
freddysblog - Al Go for Github
freddysblog - Deployment strategies and al go for github
Configuration
Click on "Use this template" button.
Once the repo is created, click on Actions.
You'll see that you have an Initial commit workflow running.
On the left side, click on "Create a new app" to get started with creating a new AL app.
Click on Run Workflow and specify the name, publisher and ID range for the new AL app.
If you want the workflow to make a commit directly, set the "Direct Commit" flag.
If this is not set, then the workflow will create a pull request, which will fail if the appropriate permissions are not granted.
Tick the "Allow Github Actions to create and approve pull requests" and click on Save.
Once you click on "Run workflow", we will see a new entry in the workflow runs window.
Clicking on it shows all the different tasks involved in this workflow.
Clicking on the individual task will show the logs and additional details of the task.
Once this is completed, in the commit history, we can see that there is new commit with a new app.
Now, I'll clone this repo locally so I can add some of my own files.
Next, we need to define a way for Github to access our Business Central environment.
For that, we need to set up an environment on Github.
Go to repository settings -> Environments -> New Environment.
Give it a proper name and click on "Configure environment"
Now, we need to get a value for the environment secret.
We can do that via powershell.
First install BcContainerHelp module.
Install-Module -Name BcContainerHelper
$AuthContext = New-BcAuthContext -includeDeviceLogin
Get-ALGoAuthContext -bcAuthContext $AuthContext | Set-Clipboard
Now, after running both the commands, the auth context will be available on your clipboard.
After commiting the changes, we can see a new entry in the workflow runs under the CI/CD workflow.
It takes care of most of the setup work, so you can focus on writing code instead of managing deployments.
This helps keep your extensions up to date, reduces manual effort, and avoids mistakes.
Comments
Post a Comment