-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (50 loc) · 1.81 KB
/
build-and-deploy.yml
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
name: "Publish BlazorApp"
on:
release:
types: [released]
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# Checkout the code
- uses: actions/checkout@v2
# Install .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x
# Generate the website
- name: Install wasm tool
run: dotnet workload install wasm-tools
- name: Update docfx
run: dotnet tool update -g docfx
- name: Build and Test
run: |
dotnet build
dotnet test
- name : Set Version variable from tag
if: (github.event_name == 'release')
run: |
TAG=${{ github.event.release.tag_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Pack NuGet Package
if: (github.event_name == 'release')
run: dotnet pack -c Release --include-symbols --include-source -p:PackageVersion=${VERSION}
- name: Publish NuGet Package
if: (github.event_name == 'release')
run: dotnet nuget push 'src/**/*.nupkg' -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
# Generate the website
- name: Publish Sample Page
run: dotnet publish ./samples/Memento.Sample.BlazorWasm/Memento.Sample.BlazorWasm.csproj -c Release -p:GHPages=true
- name: Generate Docs
run: docfx ./docfx.json
# Deploy the site
- name: Deploy Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./samples/Memento.Sample.BlazorWasm/bin/Release/net8.0/publish/wwwroot
force_orphan: true