-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (49 loc) · 1.61 KB
/
deploy.yml
File metadata and controls
59 lines (49 loc) · 1.61 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
name: Deploy Blazor to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for staleness check (git history)
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '10.0.x'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Restore dependencies
run: dotnet restore Mythril.Blazor/Mythril.Blazor.csproj
- name: Health Check & Tests
id: health_check
continue-on-error: true
run: |
python scripts/check_health.py
- name: Build Blazor App
if: always()
run: |
dotnet publish Mythril.Blazor/Mythril.Blazor.csproj -c Release -o output
# Ensure .nojekyll exists
touch output/wwwroot/.nojekyll
# Create 404.html for routing
cp output/wwwroot/index.html output/wwwroot/404.html
# Copy health metrics to hosted directory
mkdir -p output/wwwroot/health
cp scripts/data/*.json output/wwwroot/health/
echo "{\"version\": \"${{ github.sha }}\", \"timestamp\": \"$(date -u +'%Y-%m-%dT%H:%M:%SZ')\"}" > output/wwwroot/version.json
- name: Deploy to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output/wwwroot