From 84133b1378873175783746c5562b216262ea8988 Mon Sep 17 00:00:00 2001 From: Bela Bohlender Date: Tue, 16 Jul 2024 10:14:45 +0200 Subject: [PATCH] setup deploy examples --- .github/workflows/packages.yml | 8 ++-- .github/workflows/static.yml | 57 +++++++++++++++++++++++++ README.md | 1 + docs/getting-started/introduction.md | 1 + examples/minecraft/package.json | 3 +- examples/pingpong/package.json | 3 +- examples/rag-doll/package.json | 3 +- examples/room-with-shadows/package.json | 21 ++++----- examples/stage/package.json | 3 +- examples/watch/package.json | 19 +++++---- 10 files changed, 92 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index d04d2660..fc33e142 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -39,10 +39,10 @@ jobs: pnpm -r check:prettier pnpm -r check:eslint - - name: Test - run: | - pnpm exec playwright install chromium - pnpm -r test +# - name: Test +# run: | +# pnpm exec playwright install chromium +# pnpm -r test - name: Gitversion id: gitversion diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 00000000..a7befb4d --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,57 @@ +name: Deploy Static Files + +on: + push: + branches: + - main + +jobs: + deploy-static-files: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - uses: pnpm/action-setup@v2 + name: Install pnpm + with: + version: 8 + run_install: true + + # Examples + - name: Building Examples + run: | + pnpm -r build + + - name: Copy Examples + run: | + mkdir -p public/examples/minecraft + mkdir -p public/examples/pingpong + mkdir -p public/examples/rag-doll + mkdir -p public/examples/stage + mkdir -p public/examples/watch + mkdir -p public/examples/room-with-shadows + cp -r ./examples/minecraft/dist/* ./public/examples/minecraft + cp -r ./examples/pingpong/dist/* ./public/examples/pingpong + cp -r ./examples/rag-doll/dist/* ./public/examples/rag-doll + cp -r ./examples/stage/dist/* ./public/examples/stage + cp -r ./examples/watch/dist/* ./public/examples/watch + cp -r ./examples/room-with-shadows/dist/* ./public/examples/room-with-shadows + + # Deploy to GH Pages + - name: Add no jekyll + run: touch public/.nojekyll + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: public diff --git a/README.md b/README.md index f13d2437..0ff13336 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ export function App() { ## Roadmap - 🤳 XR Gestures +- ➕ Multimodal - ⚓️ Anchors - 📺 Layers - 📱 Dom Overlays diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md index 6c7071a9..6d94b994 100644 --- a/docs/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -58,6 +58,7 @@ export function App() { ## Roadmap - 🤳 XR Gestures +- ➕ Multimodal - ⚓️ Anchors - 📺 Layers - 📱 Dom Overlays diff --git a/examples/minecraft/package.json b/examples/minecraft/package.json index fb3efac0..e18bb311 100644 --- a/examples/minecraft/package.json +++ b/examples/minecraft/package.json @@ -8,6 +8,7 @@ }, "type": "module", "scripts": { - "dev": "vite --host" + "dev": "vite --host", + "build": "vite build" } } diff --git a/examples/pingpong/package.json b/examples/pingpong/package.json index 8216be86..69c913db 100644 --- a/examples/pingpong/package.json +++ b/examples/pingpong/package.json @@ -7,6 +7,7 @@ }, "type": "module", "scripts": { - "dev": "vite --host" + "dev": "vite --host", + "build": "vite build" } } diff --git a/examples/rag-doll/package.json b/examples/rag-doll/package.json index 652d07cf..bf1307f0 100644 --- a/examples/rag-doll/package.json +++ b/examples/rag-doll/package.json @@ -6,6 +6,7 @@ }, "type": "module", "scripts": { - "dev": "vite --host" + "dev": "vite --host", + "build": "vite build" } } diff --git a/examples/room-with-shadows/package.json b/examples/room-with-shadows/package.json index a8959908..743185c2 100644 --- a/examples/room-with-shadows/package.json +++ b/examples/room-with-shadows/package.json @@ -1,11 +1,12 @@ { - "dependencies": { - "@react-three/drei": "^9.108.3", - "@react-three/xr": "workspace:^", - "maath": "^0.10.8" - }, - "type": "module", - "scripts": { - "dev": "vite --host" - } -} \ No newline at end of file + "dependencies": { + "@react-three/drei": "^9.108.3", + "@react-three/xr": "workspace:^", + "maath": "^0.10.8" + }, + "type": "module", + "scripts": { + "dev": "vite --host", + "build": "vite build" + } +} diff --git a/examples/stage/package.json b/examples/stage/package.json index e76f9b79..8176e181 100644 --- a/examples/stage/package.json +++ b/examples/stage/package.json @@ -5,6 +5,7 @@ }, "type": "module", "scripts": { - "dev": "vite --host" + "dev": "vite --host", + "build": "vite build" } } diff --git a/examples/watch/package.json b/examples/watch/package.json index 8a7d8542..8176e181 100644 --- a/examples/watch/package.json +++ b/examples/watch/package.json @@ -1,10 +1,11 @@ { - "dependencies": { - "@react-three/drei": "^9.108.3", - "@react-three/xr": "workspace:^" - }, - "type": "module", - "scripts": { - "dev": "vite --host" - } -} \ No newline at end of file + "dependencies": { + "@react-three/drei": "^9.108.3", + "@react-three/xr": "workspace:^" + }, + "type": "module", + "scripts": { + "dev": "vite --host", + "build": "vite build" + } +}