Merge pull request #1142 from TrashMob-eco/main #142
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: TrashMobProd - WebApp | |
on: | |
push: | |
branches: | |
- release | |
paths: | |
- '.github/**' | |
- 'TrashMob/**' | |
- 'TrashMob.Models/**' | |
- 'TrashMob.Shared/**' | |
- 'TrashMob.Shared.Tests/**' | |
workflow_dispatch: | |
env: | |
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root | |
DOTNET_VERSION: '6.0.x' # set this to the dotnet version to use | |
DOTNET_VERSION2: '6.0.x' # set this to the dotnet version to use | |
CONFIGURATION: Release | |
jobs: | |
build: | |
runs-on: windows-latest | |
environment: production | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Setup DotNet ${{ env.DOTNET_VERSION2 }} Environment | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION2 }} | |
- name: Restore | |
run: dotnet restore .\TrashMob.sln | |
- name: dotnet publish | |
run: dotnet publish TrashMob\TrashMob.csproj --configuration ${{ env.CONFIGURATION }} --output "${{env.DOTNET_ROOT}}/trashmobwebapp" --no-restore | |
- name: Upload artifact for deployment job | |
uses: actions/[email protected] | |
with: | |
name: .net-app | |
path: "${{env.DOTNET_ROOT}}/trashmobwebapp" | |
deploy: | |
runs-on: windows-latest | |
needs: build | |
environment: | |
name: 'production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: .net-app | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'as-tm-pr-westus2' | |
slot-name: 'production' | |
publish-profile: ${{ secrets.AzureAppService_PublishProfile_bff1dbd3f03d4c789a11587a3cd86766 }} | |
package: . |