Deploy Frontend on Azure #194
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 Frontend on Azure | |
on: | |
workflow_dispatch: | |
inputs: | |
environment_name: | |
description: "Environment Name" | |
required: true | |
default: "" | |
jobs: | |
Deploy-Frontend: | |
environment: | |
name: ${{ github.event.inputs.environment_name }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/login@v2 | |
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 Frontend Artifact | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: build-frontend.yml | |
name: savings-frontend | |
branch: ${{ steps.extract_branch.outputs.branch }} | |
path: ./deploy | |
- name: Config Settings Substitution | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: 'deploy/wwwroot/appsettings.json' | |
env: | |
SavingsApiServiceUrl: ${{ vars.APPSERVICE_FE_CONFIG_APIURL }} | |
ApiKey: ${{ secrets.APPSERVICE_CONFIG_APIKEY }} | |
AuthenticationToUse: 'AzureAD' | |
AzureAd.Authority: ${{ vars.APPSERVICE_CONFIG_IDENTITY_AUTHORITY }} | |
AzureAd.ClientId: ${{ vars.APPSERVICE_FE_CONFIG_CLIENT_ID }} | |
AzureAd.ValidateAuthority: true | |
AccessTokenScope: ${{ vars.APPSERVICE_FE_CONFIG_DEFAULT_SCOPE }} | |
- name: Manifest AppName Substitution | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: 'deploy/wwwroot/manifest.json' | |
env: | |
name: "Savings ${{ github.event.inputs.environment_name }}" | |
short_name: "Savings ${{ github.event.inputs.environment_name }}" | |
- name: Recalculate SHA integrity | |
run: script/recalculate-integrity.sh | |
shell: bash | |
- name: Deploy Frontend | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: ${{ vars.APPSERVICENAME_FE }} | |
package: ./deploy |