1.7 KiB

AWS Rust

This repository contains the sources for my website: The website is built using Yew. The website is deployed to an S3 bucket and served using the AWS CloudFront CDN. Deployment from this repository is performed by a Gitea workflow.

Cargo Features

There are a number of Cargo feature flags that are used during development and during release builds. These features are as follows:

  • static feature is set when we want to build the static rendering application, called site-build, which will generate the static HTML pages for the site.
  • hydration feature is set when we're building the WebAssembly for hydration into a statically rendered page.

During development, neither static nor hydration are set. This allows commands like trunk serve to serve the WebAssembly and nicely rebuild upon file changes and so on.

During a release build, we first build the site using trunk build with the hydration feature enabled. This will build a WebAssembly module with the hydration support. Afterwards, we use cargo run to run the site-build app with the static feature set, which allows us to generate all the static pages.

trunk build --release --features hydration
cargo run --release --features static --bin site-build