Azure Resource Manager Provision and Deploy #13
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: Azure Resource Manager Provision and Deploy | |
on: workflow_dispatch | |
jobs: | |
#====== Provision and Deploy ======# | |
provision_and_deploy: | |
name: "Provision and Deploy" | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# Login to Azure | |
- name: Login to Azure | |
uses: azure/login@v2 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
# Deploy ARM template | |
- name: Deploy ARM Template | |
uses: azure/arm-deploy@v2 | |
with: | |
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
resourceGroupName: ${{ vars.RESOURCE_GROUP_NAME }} | |
template: ./infra/azuredeploy.json | |
deploymentMode: Incremental | |
parameters: staticSites_name=${{ vars.STATIC_WEB_APP_NAME }} | |
# Get Azure Static Web App deployment token | |
- name: Get Azure Static Web App deployment token | |
id: get-token | |
run: | | |
TOKEN=$(az staticwebapp secrets list --name ${{ vars.STATIC_WEB_APP_NAME }} --resource-group ${{ vars.RESOURCE_GROUP_NAME }} --query "properties.apiKey" -o tsv) | |
echo "STATIC_WEB_APP_TOKEN=$TOKEN" >> $GITHUB_ENV | |
# Deploy to Azure Static Web Apps | |
- name: Deploy | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ env.STATIC_WEB_APP_TOKEN }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
action: 'upload' | |
app_location: '/src/Blazor.WebAssembly' | |
output_location: 'wwwroot' | |
# Logout of Azure | |
- name: Logout of Azure | |
run: | | |
az logout |