Skip to content

Commit 5576ede

Browse files
committed
ci: setup basic ci
1 parent a240f08 commit 5576ede

File tree

6 files changed

+47
-35
lines changed

6 files changed

+47
-35
lines changed

.github/workflows/deploy.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to GitHub Pages
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
persist-credentials: false
16+
17+
- name: Install Rust Toolchain
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: stable
21+
22+
- name: Install and Build
23+
run: build.sh
24+
25+
- name: Deploy
26+
uses: JamesIves/[email protected]
27+
with:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
BRANCH: gh-pages
30+
FOLDER: static

.gitignore

+2-30
Original file line numberDiff line numberDiff line change
@@ -151,33 +151,5 @@ wasm-pack.log
151151
bin/
152152
pkg/
153153
dist/
154-
155-
156-
#Added by cargo
157-
#
158-
#already existing elements were commented out
159-
160-
#/target
161-
#Cargo.lock
162-
163-
164-
#Added by cargo
165-
#
166-
#already existing elements were commented out
167-
168-
#/target
169-
170-
171-
#Added by cargo
172-
#
173-
#already existing elements were commented out
174-
175-
#/target
176-
177-
178-
#Added by cargo
179-
#
180-
#already existing elements were commented out
181-
182-
#/target
183-
#Cargo.lock
154+
static/*
155+
!static/index.html

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
wasm-pack build --dev --target web --out-name wasm --out-dir ./static
2+
wasm-pack build --dev --target web --out-name wasm --out-dir ./static && rm ./static/.gitignore

src/components/home.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::components::Search;
21
use yew::prelude::*;
32

43
pub struct Home {}
@@ -21,7 +20,7 @@ impl Component for Home {
2120

2221
fn view(&self) -> Html {
2322
html! {
24-
<Search />
23+
<h1>{"Developers"}</h1>
2524
}
2625
}
2726
}

src/components/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
mod home;
2-
mod search;
32

43
pub use home::*;
5-
pub use search::*;

static/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Developers</title>
6+
<script type="module">
7+
import init from "/wasm.js";
8+
init();
9+
</script>
10+
<link rel="shortcut icon" href="#" />
11+
</head>
12+
<body></body>
13+
</html>

0 commit comments

Comments
 (0)