Skip to content

Commit

Permalink
fix(CI/CD): fix CI builds (#24)
Browse files Browse the repository at this point in the history
Co-authored-by: rupansh <[email protected]>
  • Loading branch information
rupansh-sekar-yral and rupansh authored Jan 11, 2024
1 parent 71ef0eb commit 13ab0a1
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 39 deletions.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Cargo
# will have compiled files and executables
/target/
!/target/x86_64-unknown-linux-musl
!/target/site

# These are backup files generated by rustfmt
**/**/*.rs.bk

# node e2e test tools and outputs
**/node_modules
**/test-results
**/end2end/playwright-report
**/playwright/.cache

# flyctl launch added from node_modules/.pnpm/[email protected]/node_modules/tailwindcss/stubs/.gitignore
!node_modules/.pnpm/[email protected]/node_modules/tailwindcss/stubs/**/*
fly.toml
8 changes: 8 additions & 0 deletions .github/workflows/deploy-to-production-on-merge-to-main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Deploy to Fly on push to main
on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -22,8 +23,15 @@ jobs:
~/.cargo/
target/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Rust Setup
run: |
nix-shell --run "rustup default nightly"
nix-shell --run "rustup target add x86_64-unknown-linux-musl"
nix-shell --run 'rustup target add wasm32-unknown-unknown'
- name: Build the Leptos project to `musl` output
run: nix-shell --run 'cargo leptos build --release'
env:
LEPTOS_BIN_TARGET_TRIPLE: x86_64-unknown-linux-musl
- name: Deploy a docker container to Fly.io
run: nix-shell --run 'fly deploy'
env:
Expand Down
60 changes: 30 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "leptos-ssr"
name = "hot-or-not-web-leptos-ssr"
version = "0.1.0"
edition = "2021"

Expand Down Expand Up @@ -59,7 +59,7 @@ panic = "abort"

[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
output-name = "leptos-ssr"
output-name = "hot-or-not-leptos-ssr"

# The site root folder is where cargo-leptos generate all output. WARNING: all content of this folder will be erased on a rebuild. Use it in your server setup.
site-root = "target/site"
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pkgs.mkShell {
flyctl
leptosfmt
nodejs_21
nodePackages_latest.postcss-cli
nodePackages_latest.tailwindcss
rustup
];
}
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn App() -> impl IntoView {
provide_context(Canisters::default());

view! {
<Stylesheet id="leptos" href="/pkg/leptos-ssr.css"/>
<Stylesheet id="leptos" href="/pkg/hot-or-not-leptos-ssr.css"/>

// sets the document title
<Title text="Welcome to Leptos"/>
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod handlers {
};
use leptos::provide_context;
use leptos_axum::handle_server_fns_with_context;
use leptos_ssr::{app::App, state::server::AppState};
use hot_or_not_web_leptos_ssr::{app::App, state::server::AppState};

pub async fn server_fn_handler(
State(app_state): State<AppState>,
Expand Down Expand Up @@ -55,10 +55,10 @@ async fn main() {
use handlers::*;
use leptos::*;
use leptos_axum::{generate_route_list, LeptosRoutes};
use leptos_ssr::app::*;
use leptos_ssr::fileserv::file_and_error_handler;
use leptos_ssr::state::canisters::Canisters;
use leptos_ssr::state::server::AppState;
use hot_or_not_web_leptos_ssr::app::*;
use hot_or_not_web_leptos_ssr::fileserv::file_and_error_handler;
use hot_or_not_web_leptos_ssr::state::canisters::Canisters;
use hot_or_not_web_leptos_ssr::state::server::AppState;

simple_logger::init_with_level(log::Level::Debug).expect("couldn't initialize logging");

Expand Down

0 comments on commit 13ab0a1

Please sign in to comment.