Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workflow for github page and wasm compatible example #8

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Github Page for example

on:
push:
branches:
- main
paths:
- 'example/**'
- 'src/**'
- '.github/**'

permissions:
contents: write # for committing to gh-pages branch.

jobs:
build-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup toolchain for wasm
run: |
rustup update stable
rustup default stable
rustup set profile minimal
rustup target add wasm32-unknown-unknown
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "example -> target"
- name: Download and install Trunk binary
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
- name: Build
run: |
cd example
../trunk build --release --public-url ${{ env.public_url }}
env:
public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: example/dist
single-commit: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Cargo.lock
/Cargo.lock
target/
dist/
21 changes: 6 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ description = "Grid, Flexbox, Block layout support for egui using taffy"
keywords = ["egui", "flexbox", "taffy", "layout", "ui"]
categories = ["gui"]
license = "MIT"
exclude = ["/example", "/.github"]

[dependencies]
egui = { version = "0.30", default-features = false }
Expand All @@ -19,19 +20,9 @@ taffy = { version = "0.7", default-features = false, features = ["taffy_tree"] }
default = ["taffy_default"]

taffy_default = [
"taffy/block_layout",
"taffy/content_size",
"taffy/flexbox",
"taffy/grid",
"taffy/std",
"taffy/block_layout",
"taffy/content_size",
"taffy/flexbox",
"taffy/grid",
"taffy/std",
]

[dev-dependencies]
eframe = { version = "0.30", default-features = false, features = [
"wgpu",
"accesskit",
"default_fonts",
"wayland",
"web_screen_reader",
"x11",
] }
Loading