Skip to content

Commit

Permalink
use surge
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfiol committed Oct 11, 2023
1 parent 9d11ef6 commit 3b14892
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Expand Up @@ -20,9 +20,10 @@ jobs:
pnpm install --prod
pnpm run build
- name: deploy
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
single-commit: true
git-config-email: <>
branch: gh-pages
folder: dist
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
run: |
pnpm install -g surge
surge ./dist/ sfn.surge.sh
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,4 +1,5 @@
node_modules
*.map
.env
dist/app.js
dist/app.js
dist/200.html
3 changes: 3 additions & 0 deletions build.js
@@ -1,6 +1,7 @@
import esbuild from 'esbuild';
import env from 'env-smart';
import { resolve } from 'node:path';
import { copyFile } from 'node:fs/promises';

// load .env file
env.load();
Expand Down Expand Up @@ -64,5 +65,7 @@ if (DEV) {
server.close();
});
} else {
// copy index.html -> 200.html fallback for surge.sh SPA support
await copyFile(resolve('dist/index.html'), resolve('dist/200.html'));
ctx.rebuild().finally(ctx.dispose);
}

0 comments on commit 3b14892

Please sign in to comment.