Skip to content

Commit

Permalink
fix: github pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
DerStimmler committed Jan 17, 2024
1 parent 94286a9 commit b48bc22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,20 @@ jobs:

- name: Build
env:
BASE_PATH: '/stromgedacht-web'
BASE_PATH: '/${{ github.event.repository.name }}'
run: |
pnpm build
touch build/.nojekyll
- name: Check
run: pnpm check

- name: Lint
run: pnpm lint

- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
chmod -c -R +rX "build/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
tar \
--dereference --hard-dereference \
--directory "build/" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
- name: Upload artifact
uses: actions/upload-artifact@main
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v2
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: 30
path: 'build/'

deploy-demo:
name: Deploy
Expand All @@ -74,4 +56,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2
5 changes: 1 addition & 4 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

const isDevelopment = process.env.NODE_ENV === 'development';

/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
Expand All @@ -20,8 +18,7 @@ const config = {
strict: true
}),
paths: {
base: isDevelopment ? '' : process.env.BASE_PATH,
relative: false
base: process.argv.includes('dev') ? '' : process.env.BASE_PATH
}
}
};
Expand Down

0 comments on commit b48bc22

Please sign in to comment.