Compare commits
No commits in common. "main" and "pages" have entirely different histories.
|
@ -1,34 +0,0 @@
|
||||||
on: [push]
|
|
||||||
jobs:
|
|
||||||
test_checkout:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: rust:slim-bookworm
|
|
||||||
steps:
|
|
||||||
- run: apt-get update -y && apt-get install -y git curl
|
|
||||||
- run: |
|
|
||||||
curl -L https://github.com/trunk-rs/trunk/releases/download/v0.19.1/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
|
|
||||||
mv trunk /
|
|
||||||
- run: rustup target add wasm32-unknown-unknown
|
|
||||||
- run: |
|
|
||||||
TOKEN=$(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)
|
|
||||||
mkdir -p "${GITHUB_WORKSPACE}"
|
|
||||||
cd "${GITHUB_WORKSPACE}"
|
|
||||||
git init
|
|
||||||
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
|
|
||||||
git -c http.extraHeader="Authorization: Basic ${TOKEN}" fetch origin "${GITHUB_SHA}"
|
|
||||||
git checkout "${GITHUB_SHA}"
|
|
||||||
ls
|
|
||||||
- run: /trunk build --release --public-url '.'
|
|
||||||
- run: |
|
|
||||||
cd dist
|
|
||||||
git init
|
|
||||||
git config user.email "ci_action@example.com"
|
|
||||||
git config user.name "CI"
|
|
||||||
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
|
|
||||||
TOKEN=$(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)
|
|
||||||
git -c http.extraHeader="Authorization: Basic ${TOKEN}" push origin -d pages || true
|
|
||||||
git checkout -b pages
|
|
||||||
git add *
|
|
||||||
git commit -m "gen pages"
|
|
||||||
git -c http.extraHeader="Authorization: Basic ${TOKEN}" push -u origin pages
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
/target
|
|
||||||
/dist
|
|
1158
Cargo.lock
generated
1158
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,9 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "tst"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
yew = { version = "0.21.0", features = ["csr"] }
|
|
24
README.md
24
README.md
|
@ -1,24 +0,0 @@
|
||||||
# Test Pages
|
|
||||||
|
|
||||||
Test with page generation. Juste a small yew app.
|
|
||||||
|
|
||||||
The generated pages are available here: <https://histausse.page.mineau.eu/tst_pages/>
|
|
||||||
|
|
||||||
# Gen pages:
|
|
||||||
|
|
||||||
CF <https://git.mineau.eu/histausse/tst_pages/src/branch/main/.forgejo/workflows/publish.yaml>
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone <repo>
|
|
||||||
trunk build --release --public-url '.'
|
|
||||||
cd dist
|
|
||||||
git init
|
|
||||||
git remote add origin <repo>
|
|
||||||
# remove old pages branch
|
|
||||||
git push origin -d pages
|
|
||||||
git checkout -b pages
|
|
||||||
git add *
|
|
||||||
git commit -m "gen pages"
|
|
||||||
# push new pages branch
|
|
||||||
git push -u origin pages
|
|
||||||
```
|
|
11
index.html
11
index.html
|
@ -1,10 +1 @@
|
||||||
<!DOCTYPE html>
|
<!doctype html><link as=fetch crossorigin href=./tst-8824db6c28d8c006_bg.wasm integrity=sha384-nbiKnGDYF5z4WtMY2tUyv7NUNKSbMI2t7KjaDjnn-1syVWjC2QtQneWCiMFa7li_ rel=preload type=application/wasm><link crossorigin href=./tst-8824db6c28d8c006.js integrity=sha384-L_XmEoy7Xl8nhWNcrO3Z0wZ2ucBhdlYUWCRJuTIdu6IjL3LNvWpPFGDH1tHHBt9N rel=modulepreload></head><body><h1>Hello world</h1><p>This is the main branch.</p><script type=module>import a,*as b from"./tst-8824db6c28d8c006.js";a(`./tst-8824db6c28d8c006_bg.wasm`);window.wasmBindings=b</script></body></html>
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<h1>Hello world</h1>
|
|
||||||
|
|
||||||
<p>This is the main branch.</p>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
25
src/main.rs
25
src/main.rs
|
@ -1,25 +0,0 @@
|
||||||
use yew::prelude::*;
|
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
fn App() -> Html {
|
|
||||||
let counter = use_state(|| 283870u64);
|
|
||||||
let onclick = {
|
|
||||||
let counter = counter.clone();
|
|
||||||
move |_| {
|
|
||||||
let value = (*counter * 989_909) % 1_212_149;
|
|
||||||
counter.set(value);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
html! {
|
|
||||||
<div>
|
|
||||||
<h3>{ "Pseudo Random Generator" }</h3>
|
|
||||||
<button {onclick}>{ "next" }</button>
|
|
||||||
<p>{ *counter }</p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
yew::Renderer::<App>::new().render();
|
|
||||||
}
|
|
1
tst-8824db6c28d8c006.js
Normal file
1
tst-8824db6c28d8c006.js
Normal file
File diff suppressed because one or more lines are too long
BIN
tst-8824db6c28d8c006_bg.wasm
Normal file
BIN
tst-8824db6c28d8c006_bg.wasm
Normal file
Binary file not shown.
Loading…
Reference in a new issue