From 1833aab98f62980712c18d243505e99c91ae6bcc Mon Sep 17 00:00:00 2001 From: Tim Schneider <43130816+DerStimmler@users.noreply.github.com> Date: Sun, 27 Aug 2023 10:06:05 +0200 Subject: [PATCH] chore: move basePath configuration to workflow --- .github/workflows/build.yml | 10 +++++++--- svelte.config.js | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1d7bfd..29e2895 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,11 @@ jobs: run: pnpm install - name: Build - run: pnpm build + env: + BASE_PATH: '/stromgedacht-web' + run: | + pnpm build + touch build/.nojekyll - name: Check run: pnpm check @@ -58,7 +62,7 @@ jobs: retention-days: 30 deploy-demo: - name: Deploy app + name: Deploy runs-on: ubuntu-latest needs: build permissions: @@ -68,6 +72,6 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - - name: Deploy demo to GitHub Pages + - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v1 diff --git a/svelte.config.js b/svelte.config.js index 55dcf5c..a333b54 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,7 +1,7 @@ import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/kit/vite'; -const isProduction = process.env.NODE_ENV === 'production'; +const isDevelopment = process.env.NODE_ENV === 'development'; /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -20,7 +20,7 @@ const config = { strict: true }), paths: { - base: isProduction ? '/stromgedacht-web' : '', + base: isDevelopment ? '' : process.env.BASE_PATH, relative: false } }