Deploy Backend on Azure #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Backend on Azure | |
on: | |
workflow_dispatch: | |
inputs: | |
environment_name: | |
description: "Environment Name" | |
required: true | |
default: "" | |
jobs: | |
Deploy-Backend: | |
environment: | |
name: ${{ github.event.inputs.environment_name }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_SERVICE_PRINCIPAL }} | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Download Backend Artifact | |
uses: dawidd6/[email protected] | |
with: | |
workflow: build-backend.yml | |
name: savings-backend | |
branch: ${{ steps.extract_branch.outputs.branch }} | |
path: ./deploy | |
- name: Config Settings Substitution | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: 'deploy/appsettings.json,deploy/appsettings.Development.json,deploy/appsettings.Production.json' | |
env: | |
ApiKeys: ${{ secrets.APPSERVICE_CONFIG_APIKEY }} | |
DatabasePath: 'Savings.db' | |
AuthenticationToUse: 'AzureAD' | |
IdentityProvider.Audience: ${{ vars.APPSERVICE_CONFIG_IDENTITY_AUDIENCE }} | |
IdentityProvider.Authority: ${{ vars.APPSERVICE_CONFIG_IDENTITY_AUTHORITY }} | |
- name: Deploy Backend | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: ${{ vars.APPSERVICENAME }} | |
package: ./deploy | |