Skip to content

Commit 2e8d049

Browse files
CI: Fix documentation redirect for "https://swiftwasm.org/JavaScriptKit"
1 parent 36e5788 commit 2e8d049

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,12 @@ jobs:
123123
env:
124124
SWIFT_SDK_ID_wasm32_unknown_wasip1_threads: ${{ steps.setup-wasm32-unknown-wasip1-threads.outputs.swift-sdk-id }}
125125
SWIFT_SDK_ID_wasm32_unknown_wasip1: ${{ steps.setup-wasm32-unknown-wasip1.outputs.swift-sdk-id }}
126+
- run: ./Utilities/prepare-gh-pages.sh
126127
- name: Upload static files as artifact
127128
id: deployment
128129
uses: actions/upload-pages-artifact@v4
129130
with:
130-
path: Examples/
131+
path: ./_site
131132
deploy-examples:
132133
runs-on: ubuntu-latest
133134
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Package.resolved
1313
Plugins/BridgeJS/Sources/JavaScript/package-lock.json
1414
Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/**/*.actual
1515
bridge-js.config.local.json
16+
_site/

Utilities/prepare-gh-pages.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
mkdir -p ./_site
4+
# Copy all files from ./Examples to ./_site, excluding specified path patterns
5+
rsync -av --progress ./Examples/ ./_site/ --exclude=".build"
6+
cat <<EOF > _site/index.html
7+
<!DOCTYPE html>
8+
<html lang="en">
9+
<head>
10+
<meta http-equiv="refresh" content="0; url=https://swiftpackageindex.com/swiftwasm/JavaScriptKit/documentation/javascriptkit">
11+
<title>Redirecting...</title>
12+
</head>
13+
<body>
14+
<p>If you are not redirected automatically, follow this <a href="https://swiftpackageindex.com/swiftwasm/JavaScriptKit/documentation/javascriptkit">link to JavaScriptKit documentation</a>.</p>
15+
</body>
16+
</html>
17+
EOF
18+

0 commit comments

Comments
 (0)