You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: web/docs/advanced/deployment/manually.md
+83Lines changed: 83 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -265,6 +265,89 @@ netlify deploy --prod
265
265
266
266
That is it! Your client should be live at `https://<app-name>.netlify.app` ✨
267
267
268
+
:::caution
269
+
Please do not set up the continuous deploy through the Netlify website. When deployed in this way, Netlify doesn't redirect URLs toward `index.html` but instead returns 404, which can break the user authentication functionality. Wasp by default comes with a `netlify.toml` file in `.wasp/build/web-app` that configures Netfliy correctly, but the configuration may break when deployed through the Netlify website.
270
+
271
+
It is recommended to deploy through the Netlify CLI in Github Actions. The first deploy can be through the website or manually through get a `NETLIFY_SITE_ID`, then the following deploys can be automatic.
272
+
273
+
<details>
274
+
<summary>Example Github Action (Updated for 0.15.0)</summary>
275
+
276
+
```
277
+
name: Deploy Client to Netlify
278
+
279
+
on:
280
+
push:
281
+
branches:
282
+
- main # Deploy on every push to the main branch
283
+
284
+
jobs:
285
+
deploy:
286
+
runs-on: ubuntu-latest
287
+
288
+
steps:
289
+
- name: Checkout Code
290
+
uses: actions/checkout@v2
291
+
292
+
- name: Setup Node.js
293
+
id: setup-node
294
+
uses: actions/setup-node@v4
295
+
with:
296
+
node-version: '20'
297
+
298
+
- name: Docker setup
299
+
uses: docker/setup-buildx-action@v3
300
+
301
+
- name: Install Wasp
302
+
run: curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.15.0 # Change to your Wasp version
303
+
304
+
- name: Wasp Build
305
+
run: cd ./app && wasp build
306
+
307
+
- name: Install dependencies and build Vite project
308
+
run: |
309
+
cd ./app/.wasp/build/web-app
310
+
npm install
311
+
REACT_APP_API_URL=${{ secrets.WASP_SERVER_URL }} npm run build
<summary>How do I get the Environment Variables?</summary>
327
+
328
+
-**`NETLIFY_AUTH_TOKEN`**: This is the token that allows GitHub Actions to authenticate with your Netlify account. You can generate this from the **Netlify User Settings**:
329
+
- Go to your [Netlify User Settings Page](https://app.netlify.com/user/settings).
330
+
- Scroll down to **Personal Access Tokens**.
331
+
- Click on **New Access Token** to create a new token.
332
+
333
+
-**`NETLIFY_SITE_ID`**: This is the unique identifier for your Netlify site. You can obtain this from the **Site Settings** of your site in the Netlify dashboard:
334
+
- Go to your **Netlify dashboard**.
335
+
- Click on the specific site you want to deploy.
336
+
- Go to **Site Settings** → **General** → **Site Information** → **Site ID**.
337
+
338
+
-**`WASP_SERVER_URL`**: This is the link that points to your backend and is generally only available after **deploying the backend**. This variable can be skipped when the backend is not functional or not deployed, but be aware that backend-dependent functionalities may be broken.
339
+
340
+
After obtaining the environment variables, you need to store these values securely in GitHub Secrets. To add these:
341
+
342
+
1. Go to your **GitHub repository**.
343
+
2. Navigate to **Settings** → **Secrets and variables** → **Actions** → **New repository secret**.
344
+
3. Add the following secrets:
345
+
-`NETLIFY_AUTH_TOKEN`
346
+
-`NETLIFY_SITE_ID`
347
+
-`WASP_SERVER_URL`
348
+
</details>
349
+
:::
350
+
268
351
:::note
269
352
Make sure you set this URL as the `WASP_WEB_CLIENT_URL` environment variable in your server hosting environment (e.g., Fly.io or Heroku).
0 commit comments