Skip to content

Commit af5cd41

Browse files
committed
simplifies the check. updates checkout version
1 parent 5b9645a commit af5cd41

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/publish-to-gh-pages.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
permissions:
1616
contents: write
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

2020
- name: Remove launchSettings.json (to not override ASPNETCORE_ENVIRONMENT)
2121
run: rm ${{ env.WEBAPP_PATH }}Properties/launchSettings.json
@@ -27,14 +27,14 @@ jobs:
2727
cd ${{ env.WEBAPP_PATH }}
2828
tailwindcss --input ./wwwroot/app.css --output ./wwwroot/app.min.css --minify
2929
30-
- name: Change <base href="" /> in App.razor to match gh repo name
30+
- name: Change <base href="" /> in App.razor to match GitHub repo name
3131
run: |
3232
REPO_NAME=$(echo "${{ github.repository }}" | awk -F '/' '{print $NF}')
33-
USER_NAME=$(echo "${{ github.repository_owner }}")
34-
if [ "$REPO_NAME" != "$USER_NAME.github.io" ]; then
35-
sed -i 's/<base href="\/" \/>/<base href="\/'$REPO_NAME'\/" \/>/g' ${{ env.WEBAPP_PATH }}Components/App.razor
33+
if [[ "$REPO_NAME" != *.github.io ]]; then
34+
sed -i 's|<base href="/" />|<base href="/'$REPO_NAME'/" />|g' ${{ env.WEBAPP_PATH }}/Components/App.razor
3635
fi
3736
37+
3838
- run: touch ${{ env.WEBAPP_PATH }}/wwwroot/.nojekyll #folder starting with _ are handled as jekyll. This file will prevent that.
3939
- name: Run webapp and generate static files
4040
run: |

0 commit comments

Comments
 (0)