-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.89 KB
/
frontend.yml
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
name: Publish Frontend
on:
push:
branches:
- master
paths:
- '.github/workflows/frontend.yml'
- 'src/**'
- '!src/BUTR.Site.NexusMods.Server/**'
- 'build/**'
workflow_dispatch:
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: butr/[email protected]
with:
fetch-depth: 0
github-token: ${{secrets.GITHUB_TOKEN}}
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-quality: preview
- name: Build Server
run: dotnet build src/BUTR.Site.NexusMods.Server/BUTR.Site.NexusMods.Server.csproj --configuration Release;
- name: Publish Client
run: dotnet publish src/BUTR.Site.NexusMods.Client/BUTR.Site.NexusMods.Client.csproj --configuration Release --output build;
- name: Change base href in index.html
run: sed -i 's/<base href="\/" \/>/<base href="\/BUTR.Site.NexusMods\/" \/>/g' build/wwwroot/index.html
# copy index.html to 404.html to serve the same file when a file is not found
- name: copy index.html to 404.html
run: cp build/wwwroot/index.html build/wwwroot/404.html
# add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project. (Allow files and folders starting with an underscore)
- name: Add .nojekyll file
run: touch build/wwwroot/.nojekyll
- name: Deploy to Github Pages
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: build/wwwroot
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}