-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAzureDevOpsWorkItemVisualizer.yml
More file actions
66 lines (63 loc) · 2.42 KB
/
AzureDevOpsWorkItemVisualizer.yml
File metadata and controls
66 lines (63 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: AzureDevOpsWorkItemVisualizer Blazor WebAssembly
on:
push:
branches:
- main
workflow_dispatch:
inputs:
deploy:
description: Deploy
required: false
type: boolean
default: false
env:
AZURE_WEBAPP_NAME: AzureDevOpsWorkItemVisualizer
AZURE_WEBAPP_PACKAGE_PATH: AzureDevOpsWorkItemVisualizer.BlazorWebAssembly/publish
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AzureDevOpsWorkItemVisualizer_14d0 }}
CONFIGURATION: Release
DOTNET_CORE_VERSION: 10.0.x
WORKING_DIRECTORY: AzureDevOpsWorkItemVisualizer.BlazorWebAssembly
TESTS_WORKING_DIRECTORY: AzureDevOpsWorkItemVisualizer.Core.Tests
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Update version info
run: '[System.IO.File]::WriteAllText("${{ env.WORKING_DIRECTORY }}/wwwroot/index.html", [System.IO.File]::ReadAllText("${{ env.WORKING_DIRECTORY }}/wwwroot/index.html").Replace("v###", [System.DateTime]::UtcNow.ToString("vyyyy.M.d.Hmm")))'
shell: pwsh
- name: Restore
run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
shell: pwsh
- name: Build
run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore
shell: pwsh
- name: Restore tests
run: dotnet restore "${{ env.TESTS_WORKING_DIRECTORY }}"
shell: pwsh
- name: Build tests
run: dotnet build "${{ env.TESTS_WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore
shell: pwsh
- name: Run tests
run: dotnet test "${{ env.TESTS_WORKING_DIRECTORY }}" --no-build
shell: pwsh
- name: Publish
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"
shell: pwsh
- name: Deploy
if: ${{ github.event.inputs.deploy == 'true' }}
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
publish-profile: ${{ env.AZURE_WEBAPP_PUBLISH_PROFILE }}
- name: Publish artifacts
if: ${{ github.event.inputs.deploy == 'true' }}
uses: actions/upload-artifact@v4
with:
name: webapp
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}