-
Notifications
You must be signed in to change notification settings - Fork 209
55 lines (53 loc) · 1.91 KB
/
gh-contributions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: "GitHub Contributions"
on:
workflow_dispatch:
inputs:
resourceGroupName:
type: string
description: "Resource Group where infrastructure will be deployed/updated"
required: true
default: ""
jobs:
deploy_dashboard:
runs-on: windows-2022
name: "Dashboard Backend"
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Azure Login
uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_CARML }}
enable-AzPSSession: true
- name: "Deploy infrastructure"
id: rg
uses: azure/arm-deploy@v1
with:
deploymentName: ${{ github.event.inputs.resourceGroupName }}
resourceGroupName: ${{ github.event.inputs.resourceGroupName }}
template: ./dashboards/GitHubDashboard-Contributors/infrastructure/deploy.bicep
- name: "Replace tokens"
shell: pwsh
run: |
$ConvertTokenListFunctionInput = @{
FilePath = './dashboards/GitHubDashboard-Contributors/src/local.settings.json'
TokenName = '<<PAT>>'
TokenValue = '${{ secrets.PAT }}'
}
./tools/scripts/Convert-TokenInFile.ps1 @ConvertTokenListFunctionInput -Verbose
- name: "Deploy code"
shell: pwsh
run: |
# Initialize parameters
Install-Module -Name Az.Functions -Force
$functionApp = Get-AzFunctionApp -ResourceGroupName '${{ github.event.inputs.resourceGroupName }}'
$functionAppName = $functionApp[0].Name
$DeployFunctionInputs = @{
ResourceGroup = '${{ github.event.inputs.resourceGroupName }}'
FunctionAppName = $functionAppName
Dashboard = 'GitHub'
}
# Invoke Function
./tools/scripts/deploy-function.ps1 @DeployFunctionInputs -Verbose