diff --git a/.github/workflows/template-api.yml b/.github/workflows/template-api.yml index 711e7c4..8d3fde7 100644 --- a/.github/workflows/template-api.yml +++ b/.github/workflows/template-api.yml @@ -23,7 +23,14 @@ jobs: with: azPSVersion: "3.1.0" inlineScript: | - az deployment group create -n ghactionbgtasks${{ github.sha }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Services/acr.bicep --parameters acrName=${{secrets.ACR_NAME}} + $deploymentName = 'ghactionbgtasks${{ github.sha }}' + $resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}' + $acrName = '${{ secrets.ACR_NAME }}' + + az deployment group create -n "$($deploymentName)" ` + --resource-group "$($resourceGroupName)" ` + --template-file deploy/Services/acr.bicep ` + --parameters acrName="$($acrName)" - name: Login to ACR uses: docker/login-action@v1 @@ -51,10 +58,23 @@ jobs: azPSVersion: "3.1.0" failOnStandardError: true inlineScript: | - az deployment group create -n ghaction${{ github.sha }} ` - --resource-group ${{secrets.AZURE_RESOURCE_GROUP_NAME}} ` + $deploymentName = 'ghaction${{ github.sha }}' + $resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}' + $acrName = '${{ secrets.ACR_NAME }}' + $imageTag = '${{ github.sha }}' + $administratorLogin = '${{ secrets.PODCASTDB_USER_LOGIN }}' + $administratorLoginPassword = '${{ secrets.PODCASTDB_USER_PASSWORD }}' + $storageAccountName = '${{ secrets.STORAGE_NAME }}' + $serverName= '${{ secrets.PODCASTDB_SERVER_NAME }}' + $kubernetesEnvName = '${{ secrets.KUBERNETES_ENV_NAME }}' + $workspaceName = '${{ secrets.WORKSPACE_NAME }}' + $apiName = '${{ secrets.API_RESOURCE_NAME }}' + $updaterName = '${{ secrets.UPDATER_RESOURCE_NAME }}' + + az deployment group create -n "$($deploymentName)" ` + --resource-group "$($resourceGroupName)" ` --template-file deploy/Services/api.bicep ` - --parameters acrName=${{ secrets.ACR_NAME }} imageTag=${{ github.sha }} administratorLogin=${{secrets.PODCASTDB_USER_LOGIN}} administratorLoginPassword=${{secrets.PODCASTDB_USER_PASSWORD}} storageAccountName=${{ secrets.STORAGE_NAME }} serverName=${{secrets.PODCASTDB_SERVER_NAME}} kubernetesEnvName=${{secrets.KUBERNETES_ENV_NAME}} workspaceName=${{secrets.WORKSPACE_NAME}} apiName=${{secrets.API_RESOURCE_NAME}} updaterName=${{secrets.UPDATER_RESOURCE_NAME}} + --parameters acrName="$($acrName)" imageTag="$($imageTag)" administratorLogin="$($administratorLogin)" administratorLoginPassword="$($administratorLoginPassword)" storageAccountName="$($storageAccountName)" serverName="$($serverName)" kubernetesEnvName="$($kubernetesEnvName)" workspaceName="$($workspaceName)" apiName="$($apiName)" updaterName="$($updaterName)" if( $LASTEXITCODE -ne 0 ) { exit -1 } - name: Upload Images diff --git a/.github/workflows/template-hub.yml b/.github/workflows/template-hub.yml index 8e48ab0..d4d7681 100644 --- a/.github/workflows/template-hub.yml +++ b/.github/workflows/template-hub.yml @@ -23,7 +23,20 @@ jobs: with: azPSVersion: "3.1.0" inlineScript: | - az deployment group create -n ghactionlistentogether${{ github.sha }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Services/hub.bicep --parameters 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}} + $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: diff --git a/.github/workflows/template-web.yml b/.github/workflows/template-web.yml index 69e64ba..e96b32f 100644 --- a/.github/workflows/template-web.yml +++ b/.github/workflows/template-web.yml @@ -70,7 +70,18 @@ jobs: with: azPSVersion: "3.1.0" inlineScript: | - az deployment group create -n ghaction -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Web/web.bicep --parameters webAppName=${{ secrets.WEBAPP_NAME }} servicePlanName=${{ secrets.SERVICE_PLAN_NAME }} servicePlanSku=${{ secrets.SERVICE_PLAN_SKU }} hubWebAppName=${{ secrets.HUB_WEBAPP_NAME }} apiName=${{secrets.API_RESOURCE_NAME}} updaterName=${{secrets.UPDATER_RESOURCE_NAME}} + $deploymentName = 'ghaction${{ github.sha }}' + $resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}' + $webAppName = '${{ secrets.WEBAPP_NAME }}' + $servicePlanName = '${{ secrets.SERVICE_PLAN_NAME }}' + $servicePlanSku = '${{ secrets.SERVICE_PLAN_SKU }}' + $hubWebAppName = '${{ secrets.HUB_WEBAPP_NAME }}' + $apiName = '${{ secrets.API_RESOURCE_NAME }}' + + az deployment group create -n "$($deploymentName)" ` + --resource-group "$($resourceGroupName)" ` + --template-file deploy/Web/web.bicep ` + --parameters webAppName="$($webAppName)" servicePlanName="$($servicePlanName)" servicePlanSku="$($servicePlanSku)" hubWebAppName="$($hubWebAppName)" apiName="$($apiName)" - name: Download web artifacts uses: actions/download-artifact@v3