-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.63 KB
/
Copy pathdeploy.yml
File metadata and controls
56 lines (45 loc) · 1.63 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
name: Deploy to GitHub Pages
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Repository
uses: actions/checkout@v4
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore Dependencies
run: dotnet restore WeatherChart/WeatherChart.csproj
- name: Build Blazor WASM
run: dotnet publish WeatherChart/WeatherChart.csproj -c Release -o publish
- name: Update index.html for Production
run: |
sed -i 's|<base href="/" />|<base href="/WeatherChart/" />|g' publish/wwwroot/WeatherChart/index.html
- name: Update appsettings.json for Production
run: |
cat > publish/wwwroot/WeatherChart/appsettings.json << 'EOF'
{
"BaseRoute": "/WeatherChart"
}
EOF
- name: Add .nojekyll File
run: touch publish/wwwroot/WeatherChart/.nojekyll
- name: Add Custom 404 for SPA (copy modified index.html)
run: cp publish/wwwroot/WeatherChart/index.html publish/wwwroot/WeatherChart/404.html
- name: Deploy to Public Repository
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.DEPLOY_KEY }}
external_repository: Bramzke/WeatherChart
publish_branch: gh-pages
publish_dir: ./publish/wwwroot/WeatherChart
destination_dir: .
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy from WeatherChart-Source @ ${{ github.sha }}'