-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.3 KB
/
main.yml
File metadata and controls
48 lines (40 loc) · 1.3 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
name: Deploy
# on a commit push to the gh-pages branch
on:
release:
types: [ published ]
jobs:
deploy-to-github-pages:
permissions:
contents: write
pages: write
pull-requests: write
# Use ubuntu latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET CORE SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Install .NET WASM Tools
run: dotnet workload install wasm-tools
- name: Publish project with version
run: |
dotnet publish ShelterViewer.Web.Client/ShelterViewer.Web.Client.csproj \
/p:Configuration=Release \
/p:GHPages=true \
/p:Version=${{ github.event.release.tag_name }} \
--output release
# inject a ga4 script tag into the index.html
- name: Inject GA4 script tag
uses: jake1164/ga4-ghpages@4410737285b8c8de1df70ec0432cee6de9d2e703
with:
tracking_id: ${{ secrets.GA_TRACKING_ID }}
file: release/wwwroot/index.html
- name: Commit wwwroot to Github Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: release/wwwroot
force_orphan: true