Replace Vercel as hosting provider
We have been using Vercel for some time now and it has been giving us problems whenever we want to host something else than NextJS or in general configuration.
Explore other hosting providers.
Actions:
- Test with using one of our apps (maybe
www). - Test deployment via gh actions.
- We need preview/production env.
- We need to be able to spin up previews with custom domains from gh actions (like we do previews for our PRs, pr-id.theme.designsystemet.no).
- Programatically cleanup/remove previews.
Create sub-issue for when testing for said providers.
Few suggestions:
- Netlify
- Comes with preview out of the box, almost no config needed
- Dokply (requires server)
- Cloudflare pages (https://pages.cloudflare.com/)
We have not out of nowhere gotten new problems with vercel, where it can't route anything.
I think we should prioritize this
I have done some research, and talked with other people in digdir. It looks like going for Azure (container apps for RR, and static web app for SB) is the way to go. We would then be on the same infrastructure as other teams/products, and it still supports what we do with Vercel (deploy, preview deploy)
We have not out of nowhere gotten new problems with vercel, where it can't route anything.
I think we should prioritize this
To fix this we added
"pnpm": {
"overrides": {
"@mjackson/node-fetch-server": "npm:@remix-run/node-fetch-server@^0.8.0"
}
},
to our package.json. We can probably remove this when changing to Azure
We have now gotten access to Azure, and will be testing it this week
Azure seems to work fine: https://www-test-ca-app.victoriousglacier-eb9399b9.norwayeast.azurecontainerapps.io/no The above url is only a test URL, being deployed form a docker image.
One thing that is also very nice, is that everything works the same as locally. For example #3795 is fixed without us doing anything: https://www-test-ca-app.victoriousglacier-eb9399b9.norwayeast.azurecontainerapps.io/no/fundamentals/design-tokens/sizes-and-spac
Everything is now working for previews in #4010, but we can't test production deployments properly before we merge it into main. We don't use custom domains for preview deployments anymore, and will only do this for prod deployments going forward.
Some gotchas:
- ENV vars are now set in workflow files
- Storybook uses nginx to keep deployments similar
- Docker is used to build images, and not something you need locally
When we merge the PR, this will happen:
- Make a prod deployment
- Check that everything is working
- Add a temp custom domain (i.e. prod.designsystemet.no)
- If everything is working fine, change domains to point to azure (www, themebuilder, storybook)
- Remove everything from Vercel
- Move domain away from Vercel
- Cancel Vercel subscription
we are now on Azure. Domains remain on Vercel. For now.
I think we should prioritize this