Skip to content

Commit 8ff3f8e

Browse files
committed
feat: prepare for demo
1 parent 9c90abd commit 8ff3f8e

File tree

7 files changed

+431
-1
lines changed

7 files changed

+431
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy Demo to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
# Build job
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
cache: 'npm'
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Build demo
39+
run: npm run build:demo
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v4
43+
with:
44+
# Automatically enable Pages if not already enabled
45+
enablement: true
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: './dist-demo'
51+
52+
# Deployment job
53+
deploy:
54+
runs-on: ubuntu-latest
55+
needs: build
56+
if: github.ref == 'refs/heads/main'
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lerna-debug.log*
99

1010
node_modules
1111
dist
12+
dist-demo
1213
dist-ssr
1314
*.local
1415

DEPLOYMENT.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# GitHub Pages Deployment Guide
2+
3+
This guide explains how to deploy the ASIMOV Network Widget demo to GitHub Pages.
4+
5+
## 🚀 Automatic Deployment (Recommended)
6+
7+
The repository is configured with GitHub Actions for automatic deployment:
8+
9+
1. **Enable GitHub Pages** in your repository:
10+
- Go to Settings → Pages
11+
- Set Source to "GitHub Actions"
12+
13+
2. **Push to main branch** - the demo will automatically build and deploy
14+
15+
3. **Access your demo** at: `https://asimov-protocol.github.io/asimov-network-widget/`
16+
17+
## 📝 Manual Deployment
18+
19+
If you prefer manual deployment:
20+
21+
```bash
22+
# Build the demo
23+
npm run build:demo
24+
25+
# Deploy to GitHub Pages
26+
npm run deploy
27+
```
28+
29+
## 🔧 Configuration
30+
31+
### Base Path
32+
The demo is configured for the path `/asimov-network-widget/`. If your repository has a different name, update the `base` property in `vite.demo.config.ts`:
33+
34+
```typescript
35+
base: '/your-repo-name/',
36+
```
37+
38+
### Build Scripts
39+
40+
- `npm run build:demo` - Builds the demo for production
41+
- `npm run preview:demo` - Preview the built demo locally
42+
- `npm run deploy` - Deploy to GitHub Pages using gh-pages
43+
44+
## 📁 Generated Files
45+
46+
The build creates static files in `dist-demo/`:
47+
- `index.html` - Main demo page
48+
- `assets/` - CSS and JavaScript bundles
49+
- `asimov.svg` - Logo asset
50+
51+
These files are served directly by GitHub Pages with no server-side processing required.
52+
53+
## 🌐 Live Demo
54+
55+
Once deployed, your demo will be available at:
56+
- **URL**: `https://asimov-protocol.github.io/asimov-network-widget/`
57+
- **Features**: Full interactive network simulation
58+
- **Performance**: Optimized production build with code splitting

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ const options = {
135135
/>
136136
```
137137

138+
## Live Demo
139+
140+
🌐 **[View Live Demo on GitHub Pages](https://asimov-protocol.github.io/asimov-network-widget/)**
141+
142+
Experience the full interactive network simulation with all dynamic features directly in your browser.
143+
138144
## Local Development
139145

140146
If you’d like to work with this repository directly, simply clone it and install its dependencies. Then, you can spin up the development server with the following commands:

0 commit comments

Comments
 (0)