Skip to content

Commit 282c275

Browse files
committed
add github.io links
1 parent 8954c75 commit 282c275

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ jobs:
193193
194194
- name: Create index.html
195195
run: |
196-
cat > public/index.html << 'EOF'
196+
REPO_OWNER=$(echo "${{ github.repository }}" | cut -d'/' -f1)
197+
REPO_NAME=$(echo "${{ github.repository }}" | cut -d'/' -f2)
198+
BASE_URL="https://${REPO_OWNER}.github.io/${REPO_NAME}"
199+
200+
cat > public/index.html << EOF
197201
<!DOCTYPE html>
198202
<html>
199203
<head>
@@ -205,6 +209,7 @@ jobs:
205209
li { margin: 10px 0; }
206210
a { color: #0366d6; text-decoration: none; }
207211
a:hover { text-decoration: underline; }
212+
.url { font-family: monospace; background: #f6f8fa; padding: 2px 6px; border-radius: 3px; }
208213
</style>
209214
</head>
210215
<body>
@@ -216,7 +221,7 @@ jobs:
216221
217222
for file in public/*.bin; do
218223
filename=$(basename "$file")
219-
echo " <li><a href=\"$filename\">$filename</a></li>" >> public/index.html
224+
echo " <li><a href=\"$filename\">$filename</a> - <span class=\"url\">${BASE_URL}/${filename}</span></li>" >> public/index.html
220225
done
221226
222227
cat >> public/index.html << 'EOF'

0 commit comments

Comments
 (0)