-
Notifications
You must be signed in to change notification settings - Fork 24
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
[chore] add Vercel preview for PRs #74
Conversation
Thank you! Let's wait for some new PR to check if this works, then we can close it. |
b1b9d39
to
c95a216
Compare
I've read some pages about running actions using repo tokens in a pull request coming from a fork and I found a solution (explained in details here. and here. In brief, using the So, the solution proposed by Github is to trigger the action only when a specific label is set on the PR. As label can be set by repo owner/collaborators only, it's safe. I updated this PR to trigger the action when the label "safe to preview" is added. So, the idea is first to have a look a the PR and if safe, add this label and the preview will be deployed. I let you read some information about this solution so you will be able to decide if you agree to use it or not. FYI: I did some tests by creating another Github account and forking a test repo from my account and it works as expected :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the safe to preview
label and also approved in review but no preview was generated. Anything I am missing?
This PR has to be merged on the main branch first, so the Github action related to Vercel preview will be active on the repo :) Then, each time you add |
This PR adds a Github action
Vercel / Preview
which build and deploy the cairovm.codes front-end to Vercel for every PR.A button
View Deployment
is automatically posted on the PR by the Vercel bot.Note to configure Github and Vercel properly:
npm i -g vercel@latest
cairovm.codes
, entervercel login
to log in to Vercel and thenvercel link
to create the project on Vercel and generate a.vercel
folder in local (this folder is ignored by git).cairovm.codes
and don't forget to copy it.cairovm.codes
repository on Github. In "Secrets and Variables" > "Actions", create 3 new repository secrets:orgId
value from .vercel/project.json file,projectId
value from .vercel/project.json file,Now, each time a PR is created, a new action should be visible and the deployed version should be accessible.
Still to be done: check deployed version access to see if anyone can access to the deployed version or if something has to be configured in the Vercel project settings.