Home

Awesome

Deploy Vite app to GitHub Pages using GitHub Actions + custom domain

This is just an example setup with a custom domain for my other repo: https://github.com/sitek94/vite-deploy-demo

Steps

CNAME record

Add CNAME record in your DNS settings (in my case it's Netlify):

Screenshot 2023-06-02 at 19 33 18

Vite config

Update Vite config:

export default defineConfig({
  plugins: [react()],
-  base: '/vite-deploy-demo/',
+  base: '/'
})

GitHub Pages

Update Pages settings in repository settings:

image


Preview

Screenshot 2023-06-02 at 20 11 42