2024-02-04 23:16:00 +08:00
|
|
|
name: Build and deploy .NET Core application to Web App AntDesignDocsWebApp
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2024-02-07 00:48:44 +08:00
|
|
|
|
2024-02-04 23:16:00 +08:00
|
|
|
env:
|
|
|
|
AZURE_WEBAPP_NAME: AntDesignDocsWebApp
|
2024-02-25 22:51:55 +08:00
|
|
|
AZURE_WEBAPP_PACKAGE_PATH: site/AntDesign.Docs.WebApp/published
|
|
|
|
WORKING_DIRECTORY: site/AntDesign.Docs.WebApp
|
2024-02-04 23:16:00 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2024-02-05 13:15:27 +08:00
|
|
|
if: github.repository_owner == 'ant-design-blazor'
|
|
|
|
|
2024-02-04 23:16:00 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-02-05 14:04:31 +08:00
|
|
|
|
|
|
|
- name: Setup .NET Core 3.1
|
|
|
|
uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
|
|
|
dotnet-version: 3.1.300
|
|
|
|
|
|
|
|
- name: Setup .NET Core 5.0
|
|
|
|
uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
|
|
|
dotnet-version: 5.0.100
|
|
|
|
|
|
|
|
- name: Setup .NET 6.0
|
|
|
|
uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
|
|
|
dotnet-version: 6.0.101
|
|
|
|
|
|
|
|
- name: Setup .NET 7.0
|
|
|
|
uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
|
|
|
dotnet-version: 7.0.100
|
|
|
|
|
|
|
|
- name: Setup .NET 8.0
|
2024-02-04 23:16:00 +08:00
|
|
|
uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
2024-02-07 00:48:44 +08:00
|
|
|
dotnet-version: 8.0.x
|
2024-02-05 14:04:31 +08:00
|
|
|
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: "16.x"
|
|
|
|
|
2024-02-04 23:16:00 +08:00
|
|
|
- name: Restore
|
2024-02-05 00:50:37 +08:00
|
|
|
run: dotnet restore
|
2024-02-04 23:16:00 +08:00
|
|
|
- name: Build
|
2024-02-05 13:15:27 +08:00
|
|
|
run: |
|
2024-02-05 14:04:31 +08:00
|
|
|
npm install
|
2024-02-05 13:15:27 +08:00
|
|
|
dotnet build
|
2024-02-04 23:16:00 +08:00
|
|
|
- name: Test
|
2024-02-07 00:48:44 +08:00
|
|
|
run: dotnet test "${{ env.WORKING_DIRECTORY }}"
|
2024-02-04 23:16:00 +08:00
|
|
|
- name: Publish
|
2024-02-07 00:48:44 +08:00
|
|
|
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration Release --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"
|
2024-02-04 23:16:00 +08:00
|
|
|
- name: Publish Artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: webapp
|
|
|
|
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
|
2024-02-05 13:15:27 +08:00
|
|
|
|
2024-02-04 23:16:00 +08:00
|
|
|
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.AntDesignDocsWebApp_6BBA }}
|
|
|
|
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
|