generated from Game-as-a-Service/Gaas-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
15 deletions.
There are no files selected for viewing
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
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: | ||
|