https://aka.ms/automategithubworkflow3.30
az login
az group create --name <resource-group-name> --location eastus
az appservice plan create --name <plan-name> --resource-group <resource-group-name> --is-linux
az webapp create --name <app-name> --plan <plan-name> --resource-group <resource-group-name> --runtime DOTNET:6.0
az webapp up --name <app-name> --plan <plan-name> --os-type linux --runtime DOTNET:6.0
az ad sp create-for-rbac --name <aad-app-name> --sdk-auth --role contributor --scopes /subscriptions/<subscription-id>/resourceGroups/<resource-group>
name: .NET CI
on: push
jobs:
build-job:
name: Build .NET assets
runs-on: ubuntu-latest
container: mcr.microsoft.com/dotnet/sdk:6.0
steps:
- run: dotnet --version
name: Check .NET version
- uses: actions/checkout@v2
name: Checkout code
- run: |
dotnet publish \
--configuration Release \
--output out
name: Publish .NET web application
- name: Upload published app
uses: actions/upload-artifact@v2
with:
name: web-app
path: out/
push-azure-job:
name: Publish to Azure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout code
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- run: |
az account show
name: Show account details