Add SingR #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |