Skip to content

Commit

Permalink
Auto-deploy examples to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
vladbat00 committed Jan 5, 2025
1 parent c60a105 commit 32f2ad4
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Formatter check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/deploy_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
push:
tags:
- '*'

name: Build and deploy examples

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Reset to the latest tag
run: git reset --hard $(git describe --tags --abbrev=0)

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

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

- name: Install bevy_cli
run: cargo install --git https://github.com/TheBevyFlock/bevy_cli bevy_cli

- name: Build color_test
run: bevy build --example color_test web --bundle
- name: Build paint_callback
run: bevy build --example paint_callback web --bundle
- name: Build render_egui_to_image
run: bevy build --example render_egui_to_image web --bundle
- name: Build render_to_image_widget
run: bevy build --example render_to_image_widget web --bundle
- name: Build side_panel
run: bevy build --example side_panel web --bundle
- name: Build simple
run: bevy build --example simple web --bundle
- name: Build simple_multipass
run: bevy build --example simple_multipass web --bundle
# We skip the two_windows example as it's not supported in WASM
- name: Build ui
run: bevy build --example ui web --bundle

- name: Upload the artifacts
uses: actions/upload-pages-artifact@v2
with:
path: 'target/bevy_web/web'

0 comments on commit 32f2ad4

Please sign in to comment.