-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Deploy demo from CI
committed
Dec 4, 2023
0 parents
commit 3daf2f8
Showing
9 changed files
with
1,249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.