Skip to content

Commit

Permalink
Merge pull request #1 from pedrolacerda/patch-1
Browse files Browse the repository at this point in the history
Small fixes on styling
  • Loading branch information
leandromsft authored Jul 2, 2024
2 parents 7340b35 + 330e395 commit 71836af
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ This repository contains an example of how to extract workflow execution data an
[![02-Deployment-API](https://github.com/leandromsft/github-dashboard/actions/workflows/02-Deployment-API.yml/badge.svg)](https://github.com/leandromsft/github-dashboard/actions/workflows/02-Deployment-API.yml)
[![03-Deployment-Function](https://github.com/leandromsft/github-dashboard/actions/workflows/03-Deployment-Function.yml/badge.svg)](https://github.com/leandromsft/github-dashboard/actions/workflows/03-Deployment-Function.yml)




## How it works?

![Architecture Diagram](docs/architecture-diagram.png)

1. Developer works on a GitHub repository.
1. Developer commits the code to repository.
1. Developer commits code to a repository.
1. GitHub triggers the GitHub Actions workflow.
1. GitHub Actions sends the **workflow_job** events to the API.
1. GitHub Actions sends the **workflow_run** events to the API.
1. 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.
1. GitHub Actions sends the `workflow_job` events to the API.
1. GitHub Actions sends the `workflow_run` events to the API.
1. 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.
1. The user accesses the Power BI dashboard to view the data.

## Dashboards samples
Expand All @@ -40,7 +37,7 @@ This repository contains an example of how to extract workflow execution data an

### Step 01 - Create Azure Resources

Create GitHub secrets for Azure Login (AZ_CREDENTIALS) and SQL Server password (AZ_SQL_PASSWORD).
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](.github/workflows/01-CreateAzureResources.yml).

Expand All @@ -50,27 +47,27 @@ To deploy the API that receives the webhook payload, you can run the workflow [0

### Step 03 - Deploy the Azure Function

Create GitHub secrets for SQL Server Connection String (AZ_SQL_CONNECTION_STRING). created at **Step 01**.
Create GitHub secrets for SQL Server Connection String (`AZ_SQL_CONNECTION_STRING`). created at [**Step 01**](#step-01---create-azure-resources).

To deploy the Azure Function, you can run the workflow [03-Deployment-Function.yml](.github/workflows/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.
Create a GitHub Webhook to send the `workflow_job` and `workflow_run` events to the API endpoint.

To create the webhook, on Organization level, click on **Settings**, select the **Webhooks** menu, and click on the **Add webhook** button.
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**.
In the `Payload URL` field, enter the API endpoint created at [**Step 02**](#step-02---deploy-the-api).

![WebHook Payload](docs/WebhookPayload.png)

In the Wich events would you like to trigger this webhook? select **Let me select individual events** and select the **workflow_job** and **workflow_run** events.
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](docs/WebhookEvents.png)

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.
- `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

Expand All @@ -86,4 +83,4 @@ If you want to contribute to this project, please read the [CONTRIBUTING](CONTRI

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.
This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.

0 comments on commit 71836af

Please sign in to comment.