generated from Game-as-a-Service/Gaas-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (39 loc) · 1.54 KB
/
DeployGithubPage.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Deploy Github Page
on:
push:
branches: [ "main" ]
paths: ['src/InterfaceAdapter/Gaas.GobbletGobblers.Client/**']
pull_request:
branches: [ "main" ]
paths: ['src/InterfaceAdapter/Gaas.GobbletGobblers.Client/**']
env:
REPOSITORY_NAME: 'Gobblet-Gobblers'
DOTNET_CLINET_PUBLISH_PROJECT_PATH: './src/InterfaceAdapter/Gaas.GobbletGobblers.Client'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
# 修改成專案名稱
- name: Publish .NET Core Project
run: dotnet publish ${{ env.DOTNET_CLINET_PUBLISH_PROJECT_PATH }}/Gaas.GobbletGobblers.Client.csproj -c Release -o release --nologo
# 修改 index.html 的 base href 設定
- name: 修改 index.html 的 base href 設定
run: sed -i 's/<base href="\/" \/>/<base href="\/${{ env.REPOSITORY_NAME }}\/" \/>/g' release/wwwroot/index.html
# 複製 index.html 成 404.html
- name: 複製 index.html 成 404.html
run: cp release/wwwroot/index.html release/wwwroot/404.html
# 新增 .nojekyll 檔
- name: 新增 .nojekyll 檔
run: touch release/wwwroot/.nojekyll
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: release/wwwroot