build tweaks #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Unity WebGL and Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'Unity/CraftSpace/**' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: cd SvelteKit/BackSpace && npm ci | |
| - name: Setup Unity environment | |
| run: cd SvelteKit/BackSpace && npm run unity:setup | |
| - name: Export schemas to Unity | |
| run: cd SvelteKit/BackSpace && npm run schemas:export:unity | |
| - name: Regenerate Unity schemas | |
| run: cd SvelteKit/BackSpace && npm run schemas:regenerate:unity | |
| - name: Build Unity WebGL app | |
| run: cd SvelteKit/BackSpace && npm run unity:build-webgl | |
| - name: Deploy to WebSites/spacetime | |
| run: cd SvelteKit/BackSpace && npm run unity:deploy-webgl | |
| - name: Trigger GitHub Pages deployment | |
| uses: peter-evans/repository-dispatch@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| event-type: spacetime-deploy |