Skip to content

Commit ea12477

Browse files
committed
insure .env exists before we try to build
1 parent 39418cc commit ea12477

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/pages.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,19 @@ jobs:
3535
node-version: '20.x'
3636
registry-url: 'https://registry.npmjs.org'
3737

38-
- run: npm ci
39-
- run: npm run build:github-actions
38+
- run: npm ci --ignore-scripts
4039

41-
- name: Setup Pages
40+
- run: npm run build
41+
42+
- name: setup Pages
4243
uses: actions/configure-pages@v5
4344

44-
- name: Upload artifact
45+
- name: upload artifact
4546
uses: actions/upload-pages-artifact@v3
4647
with:
4748
# Upload just the build directory
4849
path: 'build/'
4950

50-
- name: Deploy to GitHub Pages
51+
- name: deploy to GitHub Pages
5152
id: deployment
5253
uses: actions/deploy-pages@v4

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"private": false,
66
"scripts": {
77
"dev": "vite dev --host",
8-
"build": "vite build",
9-
"build:github-actions": "vite build && cp .env_example ./build/.env",
8+
"prebuild": "if [ ! -e .env ]; then cp .env_example .env; fi",
9+
"build": "npm run prebuild && vite build",
1010
"preview": "vite preview",
1111
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
1212
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",

0 commit comments

Comments
 (0)