Skip to content

Commit d1d24d3

Browse files
authored
Trying Dynamic BaseURL again (#197)
Trying Dynamic BaseURL again #197
1 parent 515cbee commit d1d24d3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,23 @@ jobs:
4848
- name: Install npm dependencies
4949
run: npm install
5050

51+
- name: Determine Base URL
52+
id: base_url
53+
run: |
54+
if [[ "${{ github.repository_owner }}.github.io" == "open-neuromorphic.github.io" ]]; then
55+
BASE_URL="https://open-neuromorphic.org/"
56+
else
57+
REPO_NAME=$(echo "${{ github.repository }}" | cut -d '/' -f 2)
58+
if [[ "${{ github.repository_owner }}" == "${{ github.repository_owner }}" ]]; then
59+
BASE_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/"
60+
else
61+
BASE_URL="https://${{ github.repository_owner }}.github.io/"
62+
fi
63+
fi
64+
echo "BASE_URL=$BASE_URL" >> $GITHUB_ENV
65+
66+
- name: Modify hugo.toml
67+
run: sed -i "s|baseURL = .*|baseURL = \"$BASE_URL\"|" hugo.toml
5168
- name: Build site
5269
run: npm run build
5370

0 commit comments

Comments
 (0)