Deploy
It is strongly recommended to use git to track your files for ease of deploying to your favourite hosting provider
After you have done creating your website, stop vai run and now run
vai build
If you plan on deploying to github pages instead, run
vai build ---github
After that, you would notice a dist/ folder at the root of your directory which contains all your minified html, css, js and search_index.json files. You should use this to deploy to your favourite hosting provider. vai has been tested successfully on
Nonetheless, it should work for most other hosting provider as well as you would just need link your build output to the root of the dist/ directory. We will only cover how to deploy to the 4 hosting providers mentioned above. If you prefer to use a different hosting provider, please refer to their documentation and follow the necessary steps.
Vercel
Signup or log in to Vercel.- Click Add New... > Project.
- Import the Git repository containing your
vaiproject. - edit the root directory and pick
dist - Click Deploy.
Netlify
- Sign up or log in to Netlify.
- From your dashboard, click Add new project > Import an existing project.
- Connect to your Git provider and select your project's repository.
- In Build Settings, go to publish directory and write the path to the
dist/folder
Cloudflare Pages
- Sign up or log in to your Cloudflare dashboard.
- In the sidebar, navigate to Workers & Pages.
- Click Create application > select the Pages tab > Connect to Git.
- Select Your Repository:
- Choose the repository for your vai project and click Begin setup.
- Configure Build Settings. In Build output directory, choose the path to your
dist/directory - Save and Deploy:
Github Pages
Some key things to take note of :
- github pages only allows the website to be hosted on either
docs/or your project root dir - You would have to change the
dist/directory todocs/or host a seperate github repo and transfer everything inside ofdist/there