GH Pages Deploy #1421
Replies: 5 comments 2 replies
-
If you use It seems like this is not what you are doing — so what are you doing? |
Beta Was this translation helpful? Give feedback.
-
When I do that I get the error
This got me fixated on thinking that Maybe I'm running into a similar issue as in #845? That one was closed as basically 'not in scope for this example', but you said this example is working for you so I have to do something different. |
Beta Was this translation helpful? Give feedback.
-
I'd recommend comparing your setup to the When you say "the template," which template are you using? |
Beta Was this translation helpful? Give feedback.
-
Just as an example, you may see a deployment workflow here: https://github.com/gear-tech/ss58.org/blob/master/.github/workflows/build.yml Note that the repo should be configured to be deployed using GitHub Actions (it is in the beta stage, though): https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow Also, you are to provide an |
Beta Was this translation helpful? Give feedback.
-
I was using this sample/template since it looked like the recommended way to get started. It does not have an
Thanks, that got me almost there! I had an issue with it expecting For anyone finding this in the future here is the deploy script that worked for me: name: Deploy to GH pages
on:
push:
branches: [ "master" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
deploy-to-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
target: wasm32-unknown-unknown
- name: Install trunk
uses: jetli/trunk-action@v0.4.0
with:
version: latest
- name: Install WASM Binary Toolkit
run: sudo apt-get install -y binaryen
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build
run: trunk build --release --public-url /REPO_NAME_HERE/ #insert your repo name
- name: Optimize WASM
run: find dist -name "*.wasm" -exec wasm-opt {} -o {} -Oz -c --dae --dce --rse -s 4 --vacuum \;
- name: Add .nojekyll file
run: touch dist/.nojekyll
- name: Run tests
run: cargo test --verbose
- name: Commit dist to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages
FOLDER: dist |
Beta Was this translation helpful? Give feedback.
-
Disclaimer: I'm not a Rust developer
I'm currently comparing several WASM frameworks (CSR only) and wanted to give leptos a try as well.
I managed to get the sample app up and running and even extend the component a bit, but now I'm struggling on how to approach the GH pages (static file) deployment.
From what I've read so far leptos is able to run on the client without a server and I suppose I have to use
trunk
somehow.Doing a release build I can clearly see files in the
site
directory, but without anyhtml
file, so something is clearly missing.Could anyone give me some pointers how to deploy to a pure CSR target?
Or are there any GH Actions samples for GH pages deployment I could take as reference?
It might be obvious for someone invested in the ecosystem, so apologies in advance :)
Beta Was this translation helpful? Give feedback.
All reactions