-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Investigate changing docs preview workflow #4027
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
Comments
@mterhar made a good suggestion
|
@jawnsy said to look here: https://docs.github.com/en/actions/reference/environments |
Another option would be to skip this workflow if it's from a fork, but then we might not catch bugs 🤔 |
@bpmct found a good solution to this:
|
While this comment doesn't help |
Yeah, and the other advantage of a public project repo is that we can |
Hmm... I know this is not my place, but can't we get the Vercel app(noticed the Coder site is deployed on Vercel)? I mean, after installing Vercel over here, and enabling that, if anyone makes a PR, even if or if it's not a docs change, it will give a preview, just to be on the safe side. You don't need extra files, all you would need is the Vercel app. Since the repo is directly connected there, it's easier than tokens and workflows, right? Edit: By "safe side", I meant, no breaking changes on the docs. |
@im-coder-lg Great question, and thanks for your contributions! We definitely want to make it easier for people outside our company to contribute to code-server, hence this issue. The reason that the preview workflow doesn't work for external contributors is that it requires a cross-repository access token, as it clones a private repository, which includes our documentation site, and uploads it to Vercel using our credentials. We've been thinking about ways to remove this limitation, perhaps by extracting the docs site into an open source project, or by making the credentials accessible to external contributors through a feature like GitHub Actions Environments, but we haven't resolved that yet. Your suggestion to investigate having Vercel build our site instead (using a webhook or similar to trigger it) is a good one and one we'll investigate as well. Thanks for that! |
Still an issue unfortunately. It appears the environment and secrets are set up, but they're not being recognized when CI runs on forks. @jawnsy suggested "checking the length of "${{ secrets.READONLY_M_DEPLOY_KEY }}" to make sure it's set to something" We can also enable debug logging. Resources
|
I think that might work. It might also bring in more contributors who want to help make JS components since the website's Next.js-based(I got that from the devtools from my browser). Moreover, it might even help to triage Next.js issues. |
I don't think we'll go that route sadly (I think since it's bundled with the main site, it would be too difficult of a task). But hopefully we can find an easy alternative! |
I just kinda hit an idea - Netlify. The reason I suggest it is because it has 100 GB of bandwidth, teams, reviewers(website), etc. It has Deploy previews that have a collaboration feature. Although it uses BrowserStack to judge your OS if you review through the previews. The best thing with Netlify is a CMS panel(you'll have to do some coding around to enable it here) so it's easy to edit too. Any ideas? |
That could work! We use Vercel already though so I don't know if it would be complicated using both Vercel and Netlify. Definitely worth considering though! I'm going to get to this shortly and then I'll share what approach we'll take. |
I actually am one of the people who deploy on both CDNs for the same project, and I think it's worth it, since Vercel is one of the best CDNs available and Netlify's Deploy Previews make it easy to review the site, so it's easy to request changes. I think you can make the deploy workflow only ofor theain branch and enable Netlify safely. That might work nicely. |
Oh really? I didn't know we had an expert in the house! Okay well I'll keep that in mind and I'll ping you when we work on this. |
I'd kinda hate to boast, but I am kind of professional in Vercel and Netlify deployments. I think I got an idea. You use Netlify for Deploy previewing, whereas you reprogram the Vercel workflow to deploy only on pushes to the main branch. I think this might solve the problems. Also, don't forget to add a good Netlify config. It's toml, so you will have to click the square brackets key often. Here's how I use it on two of my projects:
Both are from projects I contribute/own, so it's secure! But remember, mine is Docusaurus, based on React.js so you will have to tune the config as needed :) |
If you need some more help, try contacting me on Slack. I'll respond as soon as I can! |
That might work actually 🤔 I want to at least try getting Vercel deployments to work. If that doesn't work, we could consider this option. Thank you for suggesting!! |
I'm going to start working on this right now. NotesI'll update this comment with my notes as I go. Does this problem still exist?To check, I need to open a PR from a fork. Root causeIt appears to be a known limitation of GitHub Actions secrets. They can't be made available to forks. Solutions?Build site with a tool like Guess we'll just have to skip this on forks if not available |
This might help: https://stackoverflow.com/a/68804665/3015595 |
Seems to me like you are getting an idea on this... Then how would you preview the docs? |
@im-coder-lg sadly, I don't think you'll be able to :( We'll have to thoroughly check the docs in PRs but we won't have a live preview. |
We recently added a docs preview to code-server (thank you @BrunoQuaresma ) but now have an issue. If someone forks code-server, submits a PR, the docs preview fails. My hunch says we can't fix this since
m
is private and there are some tokens/secrets we rely on.https://github.com/cdr/code-server/blob/main/.github/workflows/docs-preview.yaml
https://github.com/cdr/code-server/pull/4020/checks?check_run_id=3413784650
We should investigate fixing this.
The text was updated successfully, but these errors were encountered: