Changed the Build Script to load .NET 7 #57
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
name: Deploy Contacts Web UI and API | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root | |
AZURE_WEBAPI_PACKAGE_PATH: '.' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.x | |
- name: Install dependencies | |
run: dotnet restore ./src/Contacts.sln | |
- name: Build API | |
run: dotnet build ./src/Contacts.Api/Contacts.Api.csproj --configuration Release --no-restore | |
- name: Build Web | |
run: dotnet build ./src/Contacts.WebUi/Contacts.WebUi.csproj --configuration Release --no-restore | |
- name: Test | |
run: dotnet test ./src/Contacts.sln --no-restore --verbosity normal | |
- name: Publish WebUI | |
run: dotnet publish ./src/Contacts.WebUi/Contacts.WebUi.csproj -c Release -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/webui' | |
- name: Azure WebApp - Web UI | |
uses: Azure/webapps-deploy@v2 | |
with: | |
app-name: cwjg-contacts-web | |
publish-profile: ${{ secrets.WEB_UI_PUBLISH_PROFILE }} | |
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/webui' | |
- name: Publish Web API | |
run: dotnet publish ./src/Contacts.Api/Contacts.Api.csproj -c Release -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/webapi' | |
- name: Azure WebApp - Web API | |
uses: Azure/webapps-deploy@v2 | |
with: | |
app-name: cwjg-contacts-api | |
publish-profile: ${{ secrets.WEB_API_PUBLISH_PROFILE }} | |
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/webapi' |