This repository has been archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.77 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
name: Publish Frontend
on:
push:
branches:
- master
paths:
- '.github/workflows/frontend.yml'
- 'src/**'
- '!src/NexusMods.ArticleViewer/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:
github-token: ${{secrets.GITHUB_TOKEN}}
- name: Publish with dotnet
run: dotnet publish src/NexusMods.ArticleViewer/Client/NexusMods.ArticleViewer.Client.csproj --configuration Release --output build
# changes the base-tag in index.html from '/' to 'NexusMods.ArticleViewer' to match GitHub Pages repository subdirectory
- name: Change base-tag in index.html from / to NexusMods.ArticleViewer
run: sed -i 's/<base href="\/" \/>/<base href="\/NexusMods.ArticleViewer\/" \/>/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@v3
with:
target_branch: gh-pages
build_dir: build/wwwroot
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}