Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]:Guidance on Scheduling Production Deployments and Managing Multi-Project Setup in GitHub AL-Go #1408

Open
DozUmesh opened this issue Jan 21, 2025 · 2 comments
Assignees
Labels
Fix Ready Fix Ready question Further information is requested

Comments

@DozUmesh
Copy link

Question

I’m currently using GitHub AL-Go to manage CICD for Business Central extensions and need assistance with two key areas:

  1. Scheduling a Deployment to Production
    How can I schedule a production deployment to trigger automatically once a new release is available?

  2. Handling a Multi-Project Setup
    I reviewed this guide but still have questions about managing a setup with:

  • One base app.
  • Two country-specific extensions (e.g., US and DK).

Specifically, I’m unsure about:

  • Whether the base app should sit in W1 or be duplicated in both US and DK projects.
  • The workflow for deploying to QA.
  • The process for deploying to production.

Could you provide guidance on these aspects?

@DozUmesh DozUmesh added the question Further information is requested label Jan 21, 2025
@DozUmesh DozUmesh changed the title [Question]: [Question]:Guidance on Scheduling Production Deployments and Managing Multi-Project Setup in GitHub AL-Go Jan 21, 2025
@freddydk
Copy link
Contributor

on 1. - this is not supported out-of-the-box yet. Currently you will have to run the Publish to Environment after creating a release. It is also not supported to schedule this deployment at this time. Both these things are something we are debating on how we solve this in the best way.

on 2. - this repo: https://github.com/businesscentralapps/buildorder shows how we envision this. I have a Common and a Misc project, in which we can have some apps - then there is a W1 project with the W1 version and an DK and IT project with the Danish and Italian version. UseProjectDependencies is true for AL-Go to build apps in the right order.

It is also possible to place your source code in seperate folders and then create AL-Go projects, which references the apps you want to build (https://github.com/microsoft/BCApps uses this approach) - this means that the same AL app can be build in different AL-Go projects.

On deployments to QA and PROD - current recommendation is to setup CD to QA and deploy manually to PROD.

@freddydk freddydk added the Fix Ready Fix Ready label Jan 21, 2025
@freddydk freddydk self-assigned this Jan 21, 2025
@freddydk
Copy link
Contributor

If you want to create a schedule for running PublishToEnvironment, what you would need to do currently is to create a new .yaml file in the .github/workflows folder in your repository with the following content:

f.ex. .github/workflows/PublishToProd.yaml

name: 'PublishToProd'

on:
  workflow_dispatch:
  schedule:
    - cron: "0 20 * * 5"

env:
  appVersion: 'Current'
  environmentName: 'PROD'

jobs:
  Initialization:
    runs-on: [ ubuntu-latest ]
    steps:
      - name: Trigger Publish To Environment
        uses: octokit/[email protected]
        with:
          route: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
          owner: ${{ github.repository_owner }}
          repo: ${{ github.event.repository.name }}
          workflow_id: PublishToEnvironment.yaml
          ref: main
          inputs: '{"appVersion": ${{ env.appVersion }}, "environmentName": ${{ env.environmentName}} }'
        env:
          GITHUB_TOKEN: ${{ secrets.GHTOKENWORKFLOW }}

This workflow will run every friday evening at 20:00 (8PM) and deploy the Current (which is the latest released bits) to the PROD environment.
By changing the CRON tab or the appVersion / environmentName environment variables - you can modify the behavior.

You need a working GHTOKENWORKFLOW PAT secret for this workflow to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Ready Fix Ready question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants