-
Notifications
You must be signed in to change notification settings - Fork 4
98 lines (82 loc) · 3.07 KB
/
deploy-lql-website.yml
File metadata and controls
98 lines (82 loc) · 3.07 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Deploy LQL Website to GitHub Pages
on:
workflow_call:
inputs:
version:
description: 'Package version from the release tag'
required: false
type: string
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: Lql/LqlWebsite-Eleventy/package-lock.json
- name: Build Eleventy documentation site
working-directory: Lql/LqlWebsite-Eleventy
run: |
npm ci
npm run build
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
cache: true
cache-dependency-path: 'Lql/**/*.csproj'
- name: Install .NET WebAssembly workload
run: dotnet workload install wasm-tools
- name: Restore Blazor playground dependencies
run: dotnet restore ./Lql/Nimblesite.Lql.Website/Nimblesite.Lql.Website.csproj
- name: Build Blazor transpiler playground
env:
VERSION: ${{ inputs.version }}
run: |
if [ -n "${VERSION:-}" ]; then
ASM_VERSION="${VERSION%%-*}"
dotnet build ./Lql/Nimblesite.Lql.Website/Nimblesite.Lql.Website.csproj -c Release --no-restore -p:Version="$VERSION" -p:AssemblyVersion="$ASM_VERSION" -p:FileVersion="$ASM_VERSION"
else
dotnet build ./Lql/Nimblesite.Lql.Website/Nimblesite.Lql.Website.csproj -c Release --no-restore
fi
- name: Publish Blazor transpiler playground
env:
VERSION: ${{ inputs.version }}
run: |
if [ -n "${VERSION:-}" ]; then
ASM_VERSION="${VERSION%%-*}"
dotnet publish ./Lql/Nimblesite.Lql.Website/Nimblesite.Lql.Website.csproj -c Release -o release --nologo -p:Version="$VERSION" -p:AssemblyVersion="$ASM_VERSION" -p:FileVersion="$ASM_VERSION"
else
dotnet publish ./Lql/Nimblesite.Lql.Website/Nimblesite.Lql.Website.csproj -c Release -o release --nologo
fi
- name: Mount Blazor playground under Eleventy site
run: |
sed -i 's|<base href="/" />|<base href="/playground/" />|g' release/wwwroot/index.html
rm -rf Lql/LqlWebsite-Eleventy/_site/playground
mkdir -p Lql/LqlWebsite-Eleventy/_site/playground
cp -R release/wwwroot/. Lql/LqlWebsite-Eleventy/_site/playground/
touch Lql/LqlWebsite-Eleventy/_site/.nojekyll
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: Lql/LqlWebsite-Eleventy/_site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4