Skip to content

Commit

Permalink
fix: 變更 Front-End.yml的格式為UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
aa89227 committed Aug 15, 2023
1 parent d2d1f80 commit ea6720f
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/Front-End.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
name: Deploy to GitHub Pages

# 設定值
# 設定值
env:
GitHub_Pages_PathName: "Monopoly" # 網址目錄名稱 (EX: https://app.github.io/Monopoly/ 的Monopoly部分
FRONTEND_PUBLISH_Name: "Client" # 前端專案目錄名稱(必須同專案名稱)
GitHub_Pages_PathName: "Monopoly" # 網址目錄名稱 (EX: https://app.github.io/Monopoly/ 的Monopoly部分
FRONTEND_PUBLISH_Name: "Client" # 前端專案目錄名稱(必須同專案名稱)

on:
push:
branches: [master, main, feature/Front-End-To-GitHub-Pages] #偵測分支
branches: [master, main, feature/Front-End-To-GitHub-Pages] #偵測分支
paths:
- "Client/**" #偵測目錄
- "Client/**" #偵測目錄

jobs:
deploy-to-github-pages:
# 使用ubuntu
# 使用ubuntu
runs-on: ubuntu-latest

defaults:
run:
working-directory: ${{ env.FRONTEND_PUBLISH_Name }} # 全局設定工作目錄
working-directory: ${{ env.FRONTEND_PUBLISH_Name }} # 全局設定工作目錄

steps:
# 使用checkout actions
# 使用checkout actions
- uses: actions/checkout@v3

# 安裝.NET Core SDK
# 安裝.NET Core SDK
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

# # 執行單元測試專案
# # 執行單元測試專案
# - name: Run Unit Test
# run: dotnet test --no-build

# 發佈程式到Release資料夾
# 發佈程式到Release資料夾
- name: Publish .NET Core Project
run: dotnet publish -c Release -o release --nologo

# 修改index.html的base href -- 從"/"改為"/TodoBlazor/"
# 修改index.html的base href -- 從"/"改為"/TodoBlazor/"
- name: Change base-tag in index.html from / to TodoBlazor
run: sed -i 's/<base href="\/" \/>/<base href="\/${{ env.GitHub_Pages_PathName }}\/" \/>/g' release/wwwroot/index.html

# 複製index.html內容到404.html
# 複製index.html內容到404.html
- name: copy index.html to 404.html
run: cp release/wwwroot/index.html release/wwwroot/404.html

# 加入一個.nojekyll檔案
# 加入一個.nojekyll檔案
- name: Add .nojekyll file
run: touch release/wwwroot/.nojekyll

# 將release/wwwroot的程式碼,push到gh-pages分支
# 將release/wwwroot的程式碼,push到gh-pages分支
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/[email protected]
with:
Expand Down

0 comments on commit ea6720f

Please sign in to comment.