This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 750
50 lines (44 loc) · 1.8 KB
/
template-hub.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
on:
workflow_call:
inputs:
environment:
required: true
type: string
jobs:
deploy:
environment:
name: ${{ inputs.environment }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
enable-AzPSSession: true
- name: Bicep template
uses: azure/powershell@v1
with:
azPSVersion: "3.1.0"
inlineScript: |
$deploymentName = 'ghactionlistentogether${{ github.sha }}'
$resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}'
$webAppName = '${{ secrets.HUB_WEBAPP_NAME }}'
$servicePlanName = '${{ secrets.SERVICE_PLAN_NAME }}'
$storageAccountName = '${{ secrets.STORAGE_NAME }}'
$administratorLogin = '${{ secrets.PODCASTDB_USER_LOGIN }}'
$administratorLoginPassword = '${{ secrets.PODCASTDB_USER_PASSWORD }}'
$serverName = '${{ secrets.PODCASTDB_SERVER_NAME }}'
$apiName = '${{ secrets.API_RESOURCE_NAME }}'
az deployment group create -n "$($deploymentName)" `
--resource-group "$($resourceGroupName)" `
--template-file deploy/Services/hub.bicep `
--parameters webAppName="$($webAppName)" servicePlanName="$($servicePlanName)" storageAccountName="$($storageAccountName)" administratorLogin="$($administratorLogin)" administratorLoginPassword="$($administratorLoginPassword)" serverName="$($serverName)" apiName="$($apiName)"
- uses: actions/download-artifact@v3
with:
name: drop
path: hub
- name: Azure WebApp
uses: Azure/webapps-deploy@v2
with:
app-name: ${{ secrets.HUB_WEBAPP_NAME }}
package: hub