/github-dashboard

This repository contains an example of how to create dashboards with GitHub usage.

Primary LanguageC#MIT LicenseMIT

GitHub Actions Dashboard

Note

This repository contains an example project that can be used as a reference or starting point for your own projects.

Attention: This project is not supported by the GitHub product team, the GitHub support team, or Microsoft. Any questions or issues related to the use of this project must be resolved independently. However, you can open an issue to seek help from the community.

This repository contains an example of how to extract workflow execution data and create dashboards. The data is extracted from the GitHub Actions using WebHook and saved in a SQL Server database.

CI 01-CreateAzureResources 02-Deployment-API 03-Deployment-Function

How it works?

Architecture Diagram

  1. Developer works on a GitHub repository.
  2. Developer commits code to a repository.
  3. GitHub triggers the GitHub Actions workflow.
  4. GitHub Actions sends the workflow_job events to the API.
  5. GitHub Actions sends the workflow_run events to the API.
  6. The API sends the JSON data to the Azure Blob Storage. The Azure Function reads the data from the Azure Blob Storage, process the JSON and saves it in the SQL Server database.
  7. The user accesses the Power BI dashboard to view the data.

Dashboards samples

Overview

Dashboard

Runners view

Workflow Run Dashboard

Reusable view

Workflow Job Dashboard

Duration view

Workflow Job Dashboard

How to deploy

Step 01 - Create Azure Resources

Create GitHub secrets for Azure Login (AZ_CREDENTIALS) and SQL Server password (AZ_SQL_PASSWORD).

To create the Azure resources, you can update the variables values and run the workflow 01-CreateAzureResources.yml.

Step 02 - Deploy the API

To deploy the API that receives the webhook payload, you can run the workflow 02-Deployment-API.yml.

Step 03 - Deploy the Azure Function

Create GitHub secrets for SQL Server Connection String (AZ_SQL_CONNECTION_STRING). created at Step 01.

To deploy the Azure Function, you can run the workflow 03-Deployment-Function.yml.

Step 04 - Configure the GitHub Webhook

Create a GitHub Webhook to send the workflow_job and workflow_run events to the API endpoint.

To create the webhook, at the Organization level, click on Settings, select the Webhooks menu, and click on the Add webhook button.

In the Payload URL field, enter the API endpoint created at Step 02.

WebHook Payload

In the Which events would you like to trigger this webhook? section, select Let me select individual events and select the workflow_job and workflow_run events.

WebHook Events

In the end, you will have two webhooks:

  • workflow_job event configured to the API endpoint https://[APPNAME].azurewebsites.net/api/GitHubWorkflowJob.
  • workflow_run event configured to the API endpoint https://[APPNAME].azurewebsites.net/api/GitHubWorkflowRun.

Step 05 - Deploy the Power BI Dashboard

Update the Power BI file GitHubActionsDashboard.pbix with the parameters for connection string and database name.

WebHook Payload

Upload the Power BI file to your Power BI Service.

Contributing

If you want to contribute to this project, please read the CONTRIBUTING file.

License

This project is licensed under the MIT License - see the LICENSE file for details.