Skip to content

Create README.md

Create README.md #26

Workflow file for this run

name: Deploy DotNet Core project to Azure Function App
on:
push:
branches:
- main
# CONFIGURATION
# For help, go to https://github.com/Azure/Actions
#
# 1. Set up the following secrets in your repository:
# AZURE_FUNCTIONAPP_PUBLISH_PROFILE
#
# 2. Change these variables for your configuration:
env:
AZURE_FUNCTIONAPP_NAME: cmlight # set this to your application's name
AZURE_FUNCTIONAPP_PACKAGE_PATH: './AzureFunction' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '6.0.400' # set this to the dotnet version to use
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: 'Resolve Project Dependencies Using Dotnet'
shell: bash
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet build --configuration Release --output ./output
popd
- name: 'Azure Login'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIAL }}
- name: 'Deploy ARM Template'
uses: azure/arm-deploy@v1
id: deploy
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resourceGroupName: ${{ secrets.AZURE_FUNCTIONAPP }}
template: ./AzureResources/template.json
parameters: 'LifxApiKey=${{ secrets.LIFX_API_KEY }}'
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ secrets.AZURE_FUNCTIONAPP }}
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'