diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58e21ffa..40ddf8b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,10 +19,16 @@ jobs: with: node-version: 20.x - - name: Install and Build 🔧 - run: | + - name: Install Dependencies 🔧 + run: yarn install + + - name: Build 🔧 + run: yarn run build + + - name: Post Build Actions 🛠️ + run: yarn run github-post-build env: NODE_ENV: production diff --git a/github-post-build-script.mjs b/github-post-build-script.mjs index 20cebe16..3d49512e 100644 --- a/github-post-build-script.mjs +++ b/github-post-build-script.mjs @@ -1,5 +1,5 @@ -import { cpSync } from 'fs'; -import vueConfig from './vite.config.js'; +import { cpSync, mkdirSync } from 'fs'; +import { join } from 'path'; const routes = [ "/home", @@ -10,8 +10,9 @@ const routes = [ "/privacy", ]; -const dir = vueConfig.build.outDir; -console.log(dir) +const dir = 'dist'; for (const route of routes) { - cpSync(dir + "/index.html", dir + route + "/index.html"); + const target = join(dir, route); + mkdirSync(target, { recursive: true }); + cpSync(join(dir, 'index.html'), join(target, 'index.html')); } diff --git a/vite.config.js b/vite.config.js index 3e0c2412..f9250457 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,7 +13,6 @@ export default defineConfig(({ command }) => { }, }, base: isDev ? "./" : "/solid-cockpit/", - transpileDependencies: true, build: { outDir: "dist", },