Skip to content

Commit 64a691a

Browse files
committed
Add stlite implementation of app
1 parent 7737bf8 commit 64a691a

File tree

8 files changed

+3716
-393
lines changed

8 files changed

+3716
-393
lines changed

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy to GitHub Pages
2+
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'docs/index.html'
10+
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Pages
25+
uses: actions/configure-pages@v4
26+
27+
- name: Upload artifact
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: docs
31+
32+
- name: Deploy to GitHub Pages
33+
id: deployment
34+
uses: actions/deploy-pages@v4

.nojekyll

Whitespace-only changes.

PAGES_SETUP.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[stlitepack] Github Pages Workflow mode selected.
2+
3+
To complete setup:
4+
1. **BEFORE COMMITING THE NEWLY CREATED FILES**, Go to your repository **Settings -> Pages**.
5+
2. Under "Build and deployment", set:
6+
- Source: **Github Actions**
7+
3. **NOW** commit the following files:
8+
- the deploy.yml file that has been created in .github/workflows
9+
- the `index.html` that was created in the specified folder in your repository
10+
- the `404.html` and `.nojekyll` files that have been created in the root of your repository
11+
4. Visit your deployed app at https://your-github-username.github.io/your-repo-name/
12+
- note that it may take a few minutes for the app to finish deploying

docs/404.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Redirecting…</title>
9+
<script>
10+
// Remove everything after the first segment of the app
11+
// Assumes your app is contained in a single "folder" level in the URL
12+
const segments = location.pathname.split('/').filter(Boolean);
13+
14+
// Go to the first segment if it exists, otherwise root
15+
const redirectTo = segments.length > 0 ? `/${segments[0]}/` : '/';
16+
17+
location.replace(redirectTo);
18+
</script>
19+
</head>
20+
<body>
21+
<p>Page not found. Redirecting you to the app…</p>
22+
</body>
23+
</html>

docs/index.html

Lines changed: 3037 additions & 0 deletions
Large diffs are not rendered by default.

packing_file.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from stlitepack import pack, setup_github_pages
2+
from stlitepack.pack import list_files_in_folders
3+
4+
files_to_link = list_files_in_folders(["examples", "resources"], recursive=True)
5+
6+
print(files_to_link)
7+
8+
pack(
9+
"Introduction.py",
10+
extra_files_to_link=files_to_link,
11+
prepend_github_path="Bergam0t/simpy_visualisation",
12+
run_preview_server=True,
13+
requirements=[
14+
"matplotlib",
15+
"numpy",
16+
"pandas",
17+
"plotly",
18+
"simpy==4.0.2,<5",
19+
"vidigi==1.0.0",
20+
"arrow",
21+
"setuptools",
22+
],
23+
)
24+
25+
setup_github_pages()

0 commit comments

Comments
 (0)