Skip to content

Commit

Permalink
WASM client (#6)
Browse files Browse the repository at this point in the history
* WASM package for web repl

* Yew web app for REPL

* Basic styles with Tailwind

* Handle numbers correctly

* Add default value to demo Markdown

* Update README

* Build for deployment

* Add Cloudflare deployment

* Deploy on main only

* Add cache
  • Loading branch information
brunojppb authored May 19, 2024
1 parent 4b95903 commit fa55782
Show file tree
Hide file tree
Showing 11 changed files with 1,269 additions and 15 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy_web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy Web

on:
push:
branches:
- main

jobs:
build:
name: WASM build
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write

steps:
- uses: actions/checkout@v4

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

- uses: Swatinem/rust-cache@v2
name: Rust cache

- name: Install Trunk
run: cargo install trunk

- name: Build
run: trunk build --release
working-directory: ./web_repl

- uses: actions/upload-artifact@v4
with:
name: build
path: |
web_repl/dist
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: web_repl/dist
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# Optional: Switch what branch you are publishing to.
# By default this will be the branch which triggered this workflow
branch: main
# Optional: Change the working directory
# workingDirectory: my-site
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
wranglerVersion: "3"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.vscode
.zed
.DS_Store
dist
Loading

0 comments on commit fa55782

Please sign in to comment.