Skip to content

Commit 2c03eb6

Browse files
committed
[ci] deploy with version folder
1 parent a22438b commit 2c03eb6

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

.github/workflows/deploy-app.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,45 @@ jobs:
2424
- name: Install
2525
run: npm install
2626

27+
- uses: nyaa8/package-version@v1
28+
with:
29+
path: "packages/gephi-lite/package.json"
30+
2731
- name: Build
2832
run: npm run build
33+
env:
34+
BASE_URL: /gephi-lite/v${{ env.PACKAGE_VERSION }}
35+
36+
- name: Create site folder
37+
run: mkdir -p website/v${{ env.PACKAGE_VERSION }}
38+
39+
- name: Copy gephi lite files
40+
run: cp -rf packages/gephi-lite/build/* website/v${{ env.PACKAGE_VERSION }}
41+
42+
- name: Create index page with redirection
43+
run: |
44+
cat <<EOF > website/index.html
45+
<!DOCTYPE HTML>
46+
<html lang="en-US">
47+
<head>
48+
<meta charset="UTF-8">
49+
<noscript>
50+
<meta http-equiv="refresh" content="0; url=https://gephi.org/gephi-lite/v${{ env.PACKAGE_VERSION }}/">
51+
</noscript>
52+
<script type="text/javascript">
53+
window.location.href = "https://gephi.org/gephi-lite/v${{ env.PACKAGE_VERSION }}/" + (window.location.search || '') + (window.location.hash || '')
54+
</script>
55+
<title>Page Redirection</title>
56+
</head>
57+
<body>
58+
If you are not redirected automatically, follow this <a href='https://gephi.org/gephi-lite/v${{ env.PACKAGE_VERSION }}/'>link</a>.
59+
</body>
60+
</html>
61+
EOF
2962
3063
- name: Deploy 🚀
3164
uses: JamesIves/github-pages-deploy-action@v4
3265
with:
66+
folder: website # The folder the action should deploy.
3367
branch: gh-pages # The branch the action should deploy to.
34-
folder: packages/gephi-lite/build # The folder the action should deploy.
68+
clean: false # keep what is already in the directory

0 commit comments

Comments
 (0)