Skip to content

Commit

Permalink
Deploy demo 00e42b9 to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Deploy demo from CI committed Dec 4, 2023
0 parents commit 3daf2f8
Show file tree
Hide file tree
Showing 9 changed files with 1,249 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy demo
on:
push:
paths: ["demo/**", "src/**", "Cargo.toml"]
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Install Trunk
uses: jetli/[email protected]
with:
version: "latest"
- name: Deploy GitHub Pages
run: |
cd demo
trunk build --release
git worktree add gh-pages
git config user.name "Deploy demo from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../dist/* .
git add .
git commit -m "Deploy demo $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Cargo
# will have compiled files and executables
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

/examples/**/dist
/demo/dist
/docs

.DS_Store
30 changes: 30 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Thaw UI</title>
<link
rel="shortcut icon"
href="/thaw/favicon.ico"
type="image/x-icon"
/>
<link rel="stylesheet" href="/thaw/index.css" />

<link
rel="preload"
href="/thaw/demo_bg.wasm"
as="fetch"
type="application/wasm"
crossorigin=""
/>
<link rel="modulepreload" href="/thaw/demo.js" />
</head>
<body>
<script type="module">
import init from "/thaw/demo.js";
init("/thaw/demo_bg.wasm");
</script>
</body>
</html>
Loading

0 comments on commit 3daf2f8

Please sign in to comment.