Skip to content

Commit

Permalink
Deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechu10 committed Oct 15, 2024
1 parent 9114672 commit a0f46c4
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 43 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy

on:
push:
branches: [main]

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-unknown-unknown

- name: install trunk
run: >
wget -qO- https://github.com/trunk-rs/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
&& sudo mv ./trunk /usr/bin/
- run: cargo generate-lockfile

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- run: trunk build --release

- uses: actions/upload-pages-artifact@v3
with:
path: dist/

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployments.outputs.page_url }}

steps:
- uses: actions/deploy-pages@v4
id: deployment
88 changes: 47 additions & 41 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ publish = false

[dependencies]
console_error_panic_hook = "0.1.7"
sycamore = "0.9.0-beta.3"
sycamore = "0.9.0-beta.4"
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use sycamore::prelude::*;
#[component]
fn App() -> View {
view! {
h1(class="bg-red-400") { "Sycamore" }
h1(class="bg-red-400") { "Sycamore!" }
}
}

Expand Down

0 comments on commit a0f46c4

Please sign in to comment.