-
Notifications
You must be signed in to change notification settings - Fork 5
75 lines (63 loc) · 2.22 KB
/
demo-site.yaml
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
67
68
69
70
71
72
73
74
75
name: Build & Deploy Demo Site
on:
push:
branches:
- main
workflow_dispatch:
env:
DOTNET_VERSION: '6.0'
BRANCH: 'main'
LIBRARY_PATH: 'src/PinguApps.Blazor.QRCode'
DEMO_PATH: 'src/BlazorWasmNet6'
jobs:
changes:
if: ${{ github.event_name != 'workflow_dispatch' }}
runs-on: ubuntu-latest
outputs:
changes-detected: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v2
name: Checkout
with:
ref: ${{ env.BRANCH }}
- uses: dorny/paths-filter@v2
name: Checking for changes in either demo site or library code
id: filter
with:
base: ${{ env.BRANCH }}
filters: |
changes:
- '${{ env.LIBRARY_PATH }}/**'
- '${{ env.DEMO_PATH }}/**'
- name: Annotate Changes
uses: mholetzko/[email protected]
with:
title: "Changes to build?"
info: ${{ steps.filter.outputs.changes_count }} changes - ${{ steps.filter.outputs.changes }}
deploy-to-github-pages:
needs: changes
if: ${{ !failure() && (github.event_name == 'workflow_dispatch') || needs.changes.outputs.changes-detected == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout
with:
ref: ${{ env.BRANCH }}
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Publish Project
run: dotnet publish src/BlazorWasmNet6/BlazorWasmNet6.csproj -c Release -f net6.0 --nologo
- name: Change base tag
run: sed -i 's/<base href="\/" \/>/<base href="\/Blazor.QRCode\/" \.>/g' src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot/index.html
- name: copy index.html to 404.html
run: cp src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot/index.html src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot/404.html
- name: Add .nojekyll file
run: touch src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot/.nojekyll
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot