From 14584dc25093b9a9dd02fd329ae5499de32ddd1d Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 21 Aug 2022 18:40:19 -0300 Subject: [PATCH] Refactor and .NET update Added the "What this script will do" section to make it more beginner friendly Added the "BEWARE" section for first timers and unaware users Refactored the section "CONFIGURATION" Updated the DOTNET_VERSION value to '6.0.x' so it can work with Azure Functions 4.x (https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions) Updated the step "setup-dotnet" to v2 --- .../windows-dotnet-functionapp-on-azure.yml | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/FunctionApp/windows-dotnet-functionapp-on-azure.yml b/FunctionApp/windows-dotnet-functionapp-on-azure.yml index 6d235fc6..14e834ad 100644 --- a/FunctionApp/windows-dotnet-functionapp-on-azure.yml +++ b/FunctionApp/windows-dotnet-functionapp-on-azure.yml @@ -1,30 +1,46 @@ -name: Deploy DotNet project to Azure Function App +# What this script will do: +# 1. Download the repo +# checkout: https://github.com/actions/checkout +# 2. Download and install .NET +# setup-dotnet: https://github.com/actions/setup-dotnet +# 3. Build the code +# https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build +# 4. Publish to Azure +# function-action: https://github.com/Azure/functions-action -on: - [push] +#BEWARE +#Any function that is already published in the Function App will be replaced # CONFIGURATION # For help, go to https://github.com/Azure/Actions # -# 1. Set up the following secrets in your repository: +# 1. Get the publish profile value following this tutorial here: +# https://github.com/Azure/functions-action#using-publish-profile-as-deployment-credential-recommended +# 2. Set up the publish profile value as a secret in your repository with the name: # AZURE_FUNCTIONAPP_PUBLISH_PROFILE -# -# 2. Change these variables for your configuration: +# 3. In the "env" settings, change the "your-app-name" to the name of your Azure Function App +# 4. If you are using a different envirement on Github, set in the "environment" value inside "jobs" + +name: Deploy DotNet project to Azure Function App + +on: + [push] + env: AZURE_FUNCTIONAPP_NAME: your-app-name # set this to your application's name AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root - DOTNET_VERSION: '2.2.402' # set this to the dotnet version to use + DOTNET_VERSION: '6.0.x' # set this to the dotnet version to use jobs: build-and-deploy: runs-on: windows-latest - environment: dev + environment: dev steps: - name: 'Checkout GitHub Action' uses: actions/checkout@master - name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v2 with: dotnet-version: ${{ env.DOTNET_VERSION }}