|
1 | 1 | # Deploying To a Static Website |
2 | 2 |
|
| 3 | +- [Deploying using GitHub](#deploying-using-github) |
| 4 | +- [Deploying using Netlify](#deploying-using-netlify) |
| 5 | +- [Deploying using Vercel](#deploying-using-vercel) |
| 6 | +- [Deploying using render.com](#deploying-using-rendercom) |
| 7 | + |
3 | 8 | ## Deploying using GitHub |
4 | 9 |
|
5 | 10 | Deploying your study should be relatively simple. We include a GitHub action that will build your study and deploy it to GitHub pages. The only item that the user must adjust is in the `.env` file in the root of the repository. At the top of this file, you should see `VITE_BASE_PATH="/study/"`. Change "/study/" to `"/<repo-name>/"`. |
@@ -60,13 +65,71 @@ The first build will take a bit, but once it runs, your experiment should be rea |
60 | 65 |
|
61 | 66 | If you are using Netlify as a secondary venue for anonymization purposes, you can specify which branch Netlify will use to deploy from. For instance a branch called `for-review' might remove all personnel and affiliation information. |
62 | 67 |
|
| 68 | +## Deploying using Vercel |
| 69 | + |
| 70 | +Deploying with Vercel is also straightforward and follows a very similar configuration process as the other platforms. Ensure that your VITE_BASE_PATH in your .env is like the following: |
| 71 | + |
| 72 | +``` |
| 73 | +VITE_BASE_PATH="/" |
| 74 | +``` |
| 75 | + |
| 76 | +At the root of your project, create a `vercel.json` file with the following contents: |
| 77 | + |
| 78 | +```json |
| 79 | +{ |
| 80 | + "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] |
| 81 | +} |
| 82 | +``` |
| 83 | + |
| 84 | +Then, navigate to Vercel. This will likely require you to sign in or to make an account. From the home page, create a new project. |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | +Then, on the next page, select GitHub. This will require you to authorize Vercel as a GitHub app. This will then bring up a list of repos. Select the appropriate repo. This will bring up a configuration screen for the new Vercel project. |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +You likely will not need to make any changes to the configuration. After a short period of time, this will yield a website like `https://<APP_NAME>.vercel.app/` |
| 93 | + |
| 94 | +## Deploying using render.com |
| 95 | + |
| 96 | +Deploying with render.com is a little more involved than some of the other options, but has similar bones as the other platforms. Ensure that your VITE_BASE_PATH in your .env is like the following: |
| 97 | + |
| 98 | +``` |
| 99 | +VITE_BASE_PATH="/" |
| 100 | +``` |
| 101 | + |
| 102 | +Then, navigate to render.com. This will likely require you to sign in or to make an account. From the home page, create a new project. Select "Static Site" as the type of project you want to create. |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +Then, on the next page, select GitHub. This will require you to authorize render.com as a GitHub app. This will then bring up a list of repos. Select the appropriate repo. This will bring up a configuration screen for the new render.com project. |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +On this configuration screen, make sure the following options are set (or accept these defaults if Render has already filled them in for you): |
| 111 | + |
| 112 | +- **Build Command**: `npm run build` |
| 113 | +- **Publish Directory**: `dist` |
| 114 | + |
| 115 | +After saving these settings, you will also need to add a rewrite rule. Go to your static site on Render → Redirects/Rewrites tab → Add Rule: |
| 116 | +``` |
| 117 | +Type: Rewrite |
| 118 | +Source: /* |
| 119 | +Destination: /index.html |
| 120 | +``` |
| 121 | + |
| 122 | +After adding the rewrite rule, deploy your site. After a protracted period of time, this will yield a website like `https://<APP_NAME>.onrender.com/` |
| 123 | + |
63 | 124 | <!-- Importing links --> |
| 125 | + |
64 | 126 | import StructuredLinks from '@site/src/components/StructuredLinks/StructuredLinks.tsx'; |
65 | 127 |
|
66 | 128 | <StructuredLinks |
67 | | - referenceLinks={[ |
68 | | - {name: "GitHub Pages", url: "https://docs.github.com/en/pages/quickstart"}, |
69 | | - {name: "GitHub Custom Domain", url: "https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site"}, |
70 | | - {name: "Netlify", url: "https://www.netlify.com/"} |
71 | | - ]} |
72 | | -/> |
| 129 | +referenceLinks={[ |
| 130 | +{name: "GitHub Pages", url: "https://docs.github.com/en/pages/quickstart"}, |
| 131 | +{name: "GitHub Custom Domain", url: "https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site"}, |
| 132 | +{name: "Netlify", url: "https://www.netlify.com/"}, |
| 133 | +{name: "Vercel", url: "https://vercel.com/"}, |
| 134 | +{name: "render.com", url: "https://render.com/"} |
| 135 | +]}/> |
0 commit comments