-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added YML generated from Visual Studio (#151)
- Loading branch information
1 parent
fb2d40e
commit ecbe0b9
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Deploy Web to Azure | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
branches: [ "main" ] | ||
|
||
|
||
env: | ||
AZURE_WEBAPP_NAME: TagzApp | ||
AZURE_WEBAPP_PACKAGE_PATH: ./published | ||
CONFIGURATION: Release | ||
DOTNET_CORE_VERSION: 7.0.x | ||
WORKING_DIRECTORY: . | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_CORE_VERSION }} | ||
- name: Restore | ||
run: dotnet restore "${{ env.WORKING_DIRECTORY }}" | ||
- name: Build | ||
run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore | ||
- name: Test | ||
run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build | ||
- name: Publish | ||
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}" | ||
- name: Publish Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: webapp | ||
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Download artifact from build job | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: webapp | ||
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
- name: Deploy to Azure WebApp | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: ${{ env.AZURE_WEBAPP_NAME }} | ||
publish-profile: ${{ secrets.TagzApp_1363 }} | ||
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} |