Skip to content

Commit

Permalink
refactor of js13k game deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
gtanczyk committed Aug 25, 2024
1 parent d18050b commit e490ba4
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Deploy to Github pages

on:
workflow_run:
workflows: ["Lint and test"]
workflows: ['Lint and test']
branches: [master]
types:
- completed
Expand All @@ -25,8 +25,8 @@ jobs:
- uses: actions/setup-node@v2-beta
with:
node-version: '18'
- run: npm install
- run: npm run build
- run: npm install --prefix=../js13k2024/game && npm install
- run: npm run build --prefix=../js13k2024/game && npm run build

- name: Deploy website
uses: JamesIves/github-pages-deploy-action@releases/v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ matrix.nodejs }}
- run: npm install
- run: npm install --prefix=../js13k2024/game && npm install
- run: npm run lint
- run: npm run test
- run: npm run build
- run: npm run build --prefix=../js13k2024/game && npm run build
2 changes: 1 addition & 1 deletion js13k2024/game/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "gtanczyk-js13k-2024",
"name": "monsters-steps",
"version": "1.0.0",
"description": "A triskaidekaphobia-themed game for js13k 2024",
"main": "dist/index.html",
Expand Down
1 change: 1 addition & 0 deletions js13k2024/game/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import checker from 'vite-plugin-checker';

// https://vitejs.dev/config/
export default defineConfig({
base: './',
build: {
outDir: 'dist',
},
Expand Down
20 changes: 20 additions & 0 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.2.7",
"monsters-steps": "file:../js13k2024/game",
"prettier": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
1 change: 0 additions & 1 deletion website/src/games/monster-steps

This file was deleted.

4 changes: 0 additions & 4 deletions website/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const router = createBrowserRouter([
path: '/games/nukes',
lazy: async () => ({ Component: (await import('./games/nukes/NukesApp.tsx')).NukesApp }),
},
{
path: '/games/monster-steps',
lazy: async () => ({ Component: (await import('./games/monster-steps/main.tsx')).MonsterStepsApp }),
},
]);

export default function Routes() {
Expand Down
7 changes: 4 additions & 3 deletions website/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default defineConfig({
outDir: 'build',
},
resolve: {
preserveSymlinks: true
preserveSymlinks: true,
},
plugins: [
react(),
Expand All @@ -21,8 +21,9 @@ export default defineConfig({
dest: 'games/nukes',
},
{
src: 'build/index.html',
dest: 'games/monster-steps',
src: '../js13k2024/game/dist',
dest: 'games/',
rename: 'monster-steps',
},
],
}),
Expand Down

0 comments on commit e490ba4

Please sign in to comment.