2022-12-05 23:09:27 +08:00
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
environment:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
environment:
|
2022-12-05 23:19:43 +08:00
|
|
|
name: ${{ inputs.environment }}
|
2022-12-05 23:09:27 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: azure/login@v1
|
|
|
|
with:
|
2022-12-05 23:17:52 +08:00
|
|
|
creds: ${{ env.AZURE_CREDENTIALS }}
|
2022-12-05 23:09:27 +08:00
|
|
|
|
|
|
|
- name: Deploy Bicep template
|
|
|
|
uses: azure/powershell@v1
|
|
|
|
with:
|
|
|
|
azPSVersion: "3.1.0"
|
|
|
|
inlineScript: |
|
2022-12-05 23:17:52 +08:00
|
|
|
az deployment group create -n ghaction -g ${{ env.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Web/web.bicep --parameters webAppName=${{ env.WEBAPP_NAME }} servicePlanName=${{ env.SERVICE_PLAN_NAME }} servicePlanSku=${{ env.SERVICE_PLAN_SKU }} hubWebAppName=${{ env.HUB_WEBAPP_NAME }}
|
2022-12-05 23:09:27 +08:00
|
|
|
|
|
|
|
- name: Download web artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: drop
|
|
|
|
path: web
|
|
|
|
|
|
|
|
- name: Azure WebApp
|
|
|
|
uses: Azure/webapps-deploy@v2
|
|
|
|
with:
|
|
|
|
app-name: ${{ secrets.WEBAPP_NAME }}
|
|
|
|
package: web
|