diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..bd4b886 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,50 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ['main'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: 'pages' + cancel-in-progress: true + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: 1.0.18 + - name: Install dependencies + run: bun install + - name: Build + run: bun run build + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload dist repository + path: './dist' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/index.html b/index.html index e4b78ea..09ee238 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Vite + React + TS + luma-web-r3f-sample
diff --git a/public/venice_sunset_1k.hdr b/public/venice_sunset_1k.hdr deleted file mode 100644 index 048bb13..0000000 Binary files a/public/venice_sunset_1k.hdr and /dev/null differ diff --git a/src/App.tsx b/src/App.tsx index 71fb787..3019817 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,8 +1,12 @@ import { useState } from "react"; import { CustomCanvas } from "./components/CustomCanvas"; import { Luma } from "./components/Luma"; -import { AdaptiveDpr, OrbitControls, PerspectiveCamera } from "@react-three/drei"; -import { VRButton, XR, Controllers, Hands } from '@react-three/xr' +import { + AdaptiveDpr, + OrbitControls, + PerspectiveCamera, +} from "@react-three/drei"; +import { VRButton, XR, Controllers, Hands } from "@react-three/xr"; export const App = () => { const [autoRotate, setAutoRotate] = useState(true); diff --git a/src/components/Luma/index.tsx b/src/components/Luma/index.tsx index f631e01..6576211 100644 --- a/src/components/Luma/index.tsx +++ b/src/components/Luma/index.tsx @@ -9,10 +9,8 @@ declare module "@react-three/fiber" { } } -export const Luma = (props: Object3DNode) => { - return ( - - ); +export const Luma = ( + props: Object3DNode, +) => { + return ; }; diff --git a/vite.config.ts b/vite.config.ts index 861b04b..df103c6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,11 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react-swc' // https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], -}) +export default defineConfig(({ mode }) => { + return { + base: mode === "production" + ? "/luma-three-testbed/" + : "/", + plugins: [react()], + } +});