Skip to content

Merge Main to release (#1742) #176

Merge Main to release (#1742)

Merge Main to release (#1742) #176

# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: TrashMob Prod - FunctionApp
on:
push:
branches:
- release
paths:
- '.github/**'
- 'TrashMobJobs/**'
- 'TrashMob.Models/**'
- 'TrashMob.Shared/**'
- 'TrashMob.Shared.Tests/**'
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_NAME: fa-tm-pr-westus2
AZURE_FUNCTIONAPP_PACKAGE_PATH: TrashMobJobs/publish
CONFIGURATION: Release
DOTNET_CORE_VERSION: 8.0.x
WORKING_DIRECTORY: TrashMobJobs
DOTNET_CORE_VERSION_INPROC: 8.0.x
jobs:
build-and-deploy:
runs-on: windows-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: version_step # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Setup .NET Core (for inproc extensions)
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION_INPROC }}
- name: Restore
run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
- name: Publish
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore --output "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}"
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'fa-tm-pr-westus2'
slot-name: 'production'
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_932dc1333e1f404b98588de2aa51d9c4 }}