2022-12-05 18:37:56 +03:00
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
environment:
|
|
|
|
required: true
|
|
|
|
type: string
|
2022-12-07 17:28:10 +03:00
|
|
|
|
2022-12-05 18:37:56 +03:00
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
environment:
|
2022-12-07 17:28:10 +03:00
|
|
|
name: ${{ inputs.environment }}
|
2022-12-05 18:37:56 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-12-07 17:28:10 +03:00
|
|
|
|
2022-12-05 18:37:56 +03:00
|
|
|
- uses: azure/login@v1
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
|
|
|
enable-AzPSSession: true
|
|
|
|
|
|
|
|
- name: Bicep template
|
|
|
|
uses: azure/powershell@v1
|
|
|
|
with:
|
2022-12-07 17:28:10 +03:00
|
|
|
azPSVersion: "3.1.0"
|
|
|
|
inlineScript: |
|
2023-02-12 00:31:56 +03:00
|
|
|
$deploymentName = 'ghactionlistentogether${{ github.sha }}'
|
|
|
|
$resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}'
|
2023-02-12 00:45:20 +03:00
|
|
|
$webAppName = '${{ secrets.HUB_WEBAPP_NAME }}'
|
2023-02-12 00:31:56 +03:00
|
|
|
$servicePlanName = '${{ secrets.SERVICE_PLAN_NAME }}'
|
|
|
|
$storageAccountName = '${{ secrets.STORAGE_NAME }}'
|
|
|
|
$administratorLogin = '${{ secrets.PODCASTDB_USER_LOGIN }}'
|
|
|
|
$administratorLoginPassword = '${{ secrets.PODCASTDB_USER_PASSWORD }}'
|
|
|
|
$serverName = '${{ secrets.PODCASTDB_SERVER_NAME }}'
|
2023-02-12 00:48:52 +03:00
|
|
|
$apiName = '${{ secrets.API_RESOURCE_NAME }}'
|
2023-02-11 23:16:43 +03:00
|
|
|
|
|
|
|
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)"
|
2022-12-05 18:37:56 +03:00
|
|
|
|
2022-12-05 18:42:44 +03:00
|
|
|
- uses: actions/download-artifact@v3
|
2022-12-05 18:37:56 +03:00
|
|
|
with:
|
|
|
|
name: drop
|
|
|
|
path: hub
|
|
|
|
|
|
|
|
- name: Azure WebApp
|
|
|
|
uses: Azure/webapps-deploy@v2
|
|
|
|
with:
|
|
|
|
app-name: ${{ secrets.HUB_WEBAPP_NAME }}
|
2022-12-07 17:28:10 +03:00
|
|
|
package: hub
|