File tree Expand file tree Collapse file tree 3 files changed +37
-23
lines changed
Expand file tree Collapse file tree 3 files changed +37
-23
lines changed Original file line number Diff line number Diff line change @@ -40,57 +40,68 @@ jobs:
4040
4141 - name : Run tests
4242 run : cargo test
43-
44- pages :
45- name : Deploy Demo App
43+
44+ build :
45+ name : Build Demo App
4646 needs : test
4747 if : github.event_name == 'push'
4848 runs-on : ubuntu-latest
49- environment :
50- name : github-pages
51- url : ${{ steps.deployment.outputs.page_url }}
5249 steps :
5350 - uses : actions/checkout@v4
5451
55- - name : Setup Rust
56- uses : dtolnay/rust-toolchain@stable
52+ - name : Restore cache
53+ uses : actions/cache@v3
5754 with :
58- targets : wasm32-unknown-unknown
59-
60- - name : Update Rust toolchain
61- run : rustup update stable
55+ path : |
56+ ~/.cargo/bin
57+ ~/.cargo/git
58+ ~/.cargo/registry
59+ target
60+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
6261
6362 - name : Install Trunk
64636564 with :
6665 version : ' latest'
6766
68- - name : Install wasm-bindgen-cli
69- run : cargo install wasm-bindgen-cli
67+ - name : Add WASM target
68+ run : rustup target add wasm32-unknown-unknown
7069
7170 - name : Build Demo App
7271 run : |
7372 cd demo
74- trunk build --release
73+ RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk build --public-url "/bigcolor" --release
7574
7675 - name : Setup Pages
7776 uses : actions/configure-pages@v5
7877
79- - name : Create deployment directory
80- run : |
81- mkdir -p _site
82- cp -r demo/dist/* _site/
83-
8478 - name : Upload artifact
8579 uses : actions/upload-pages-artifact@v3
86-
80+ with :
81+ path : " demo/dist"
82+
83+ deploy :
84+ name : Deploy to GitHub Pages
85+ needs : build
86+ if : github.event_name == 'push'
87+ runs-on : ubuntu-latest
88+
89+ permissions :
90+ pages : write
91+ id-token : write
92+
93+ environment :
94+ name : github-pages
95+ url : ${{ steps.deployment.outputs.page_url }}
96+
97+ steps :
8798 - name : Deploy to GitHub Pages
8899 id : deployment
89100 uses : actions/deploy-pages@v4
90101
91102 release :
92103 name : Semantic Release
93- needs : [test, pages ]
104+ needs : [test, deploy ]
94105 if : github.event_name == 'push'
95106 runs-on : ubuntu-latest
96107 permissions :
Original file line number Diff line number Diff line change 11<p align =" center " >
22 <br />
3- <a target =" _blank " ><img width =" 256px " src =" public/logo.png " /></a >
3+ <a target =" _blank " ><img width =" 256px " src =" https://github.com/ducflair/bigcolor/blob/main/ public/logo.png?raw=true " /></a >
44 <p align =" center " >Rust Color Parser & Manipulation Library</p >
55 <p align =" center " style =" align : center ;" >
66 <a href="https://crates.io/crates/bigcolor/"><img src="https://shields.io/badge/Crates-FFC933?logo=Rust&logoColor=646464&style=round-square" alt="Crates" /></a>
Original file line number Diff line number Diff line change 22# Build in release mode
33release = false
44
5+ # The public URL path for assets when deployed
6+ public_url = " /bigcolor/"
7+
58[watch ]
69# Watch for changes in these directories
710watch = [" src" , " index.html" , " styles.css" ]
You can’t perform that action at this time.
0 commit comments