Skip to content

This is an example to show how can one use taskgroups/template in GitHub workflows similar to how it is possible in Azure DevOps

License

Notifications You must be signed in to change notification settings

deep-mm/TaskgroupGitHubWorkflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

TaskgroupGitHubWorkflow

This is an example to show how can one use taskgroups/template in GitHub workflows similar to how it is possible in Azure DevOps

If you are someone coming from Azure DevOps world to GitHub DevOps tools, 2 major things you would be missing are variable groups and templates. This repository demonstrates how we can get these two features in GitHub by utilizing actions available in GitHub marketplace.

There are 2 ways to achieve this:

1. GitHub Composite Action

GitHub Composite action allows one to create a template file containing composite actions. This template file in GitHub is known as a composite action. A composite action takes an input of a variable, and then we can utilize these variables to run same set of actions but in different environments. For our example, we have created a composite action called deploy-azure.

This action takes an input of variable environment, which is then utilized in subsequent steps. This action has 3 composite steps:

  1. Echo output
  2. Set environment variables - depending on variable input select the variable group
  3. Create resource group - depending on variable input deploy the resource group

Then this composite action is utilized in our main workflow Template-Action-Composite, in all three jobs release_dev, release_qa & release_prd. The only change being in the input provided to the composite action.

The output here looks something like this: image

2. Running single workflow in different environments

Template Workflow Diagram

Detailed information about the same can be found here: https://deepmehta.co.in/posts/github-template/

About

This is an example to show how can one use taskgroups/template in GitHub workflows similar to how it is possible in Azure DevOps

Resources

License

Stars

Watchers

Forks

Packages

No packages published