-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate @kadena/docs to use Vercel CLI to deploy to preview environments. #2249
base: main
Are you sure you want to change the base?
Conversation
|
…apps associated with a PR in one go
28c0069
to
507216c
Compare
This PR is stale because it is open for 60 days with no activity |
Deploy to Vercel using Vercel CLI instead of Vercel/Github Integration
Related Issue/Asana ticket: https://app.asana.com/0/1206316065856327/1207502646350161/f
Short description:
This PR adds preview deployments for @kadena/docs by using the Vercel CLI instead of relying on the Vercel/GitHub integration. This allows us to build our apps on GitHub runners and then upload prebuilt sources for deployment. For Docs this reduces deployment time from around 6-7 minutes to around 40-60 seconds. This should greatly reduce the time developers need to spent waiting for their deployment to be ready, especially when all other apps are migrated too
The deployment workflow uses
turbo-ignore
to check for differences between the current branch and the base branch to determine if a deployment for an app is required. If a deployment is required, the Vercel CLI wil pull environment variables, build the app, create a tgz archive and upload to Vercel after which a deployment will be triggered.The deployment URL is then added to environments like so:
![image](https://private-user-images.githubusercontent.com/72976986/338165275-85e899fd-a4b7-42f7-8b40-5e51635c9a71.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ5ODA2MzUsIm5iZiI6MTcyNDk4MDMzNSwicGF0aCI6Ii83Mjk3Njk4Ni8zMzgxNjUyNzUtODVlODk5ZmQtYTRiNy00MmY3LThiNDAtNWU1MTYzNWM5YTcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMwVDAxMTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIxZmQ3YTQ0NGYyZjY3MjVkZTQwMDRmZjkxN2M2NDA3OWI1NWE1MDA2OWFjZDc3YTFlZGVlMmY4YTE1M2MyYzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xfhybk-g8p1FiZjazkA45kppoELd9Rtgm6JmxNx6iQ4)
In short, this results in the following benefits:
Unfortunately, it's not all sunshine and rainbows there are also a few disadvantages. We lose branch-names for preview URLs. So instead of a branch name like
https://alpha-docs-git-feat-kadena-clipactjs-kadena-js.vercel.app/
, the generated preview url is more likehttps://alpha-docs-3dn06fmjg-kadena-js.vercel.app/
Tasks
<repository>-<pr_number>
Test scenarios
Reminders (if applicable)
pnpm install
andpnpm test
in the root of the monorepo(optionally with
--filter=...package...
to exclude non-affectedprojects)
pnpm changeset
in the root of the monorepodocs.kadena.io)