-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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(ci): setup auto docs publish workflow for release vX.X.X tag #7331
chore(ci): setup auto docs publish workflow for release vX.X.X tag #7331
Conversation
374bcca
to
faf559b
Compare
@ShenQingchuan in Vitest we have a setup that shows a preview for each commit that affects the docs: vitest-dev/vitest#970. Would the action you used here do the same? @antfu do you have a link to guide us to do the same you did for Vitest here? |
Actually, it's the default behavior of Netlify - unless you disable it explicitly. I guess it's done by Evan for a reason 👀 |
Added for discussion in the next meeting, let's check with him then. |
No, the setup I made here is for release docs publish. Could you please let me sit in on the next internal meeting when talking about this issue ( for only once 😊 ) |
faf559b
to
419b18e
Compare
2nd UpdateWhat's new? I've removed the config field
It would generate "Preview" deploy as expected when we modified and pushed anything under References for your need: |
And I'm supposed to provide some more information... the "Preview Build" is indeed a feature of Netlify but it's not by default, it depends on which branch you assign as a "Production branch"
|
Sorry for taking so much time @ShenQingchuan, v2.9 is out now, so getting back to this. Some questions:
|
Hi, @patak-dev Sorry for take so long to notify that this issue got an update! I would like to answer your questions one by one:
|
For the question 4: I may need to get it more clear ... Do we just need to publish docs on |
only trigger production build for core release
. 4. Yes, only for . 3. Yes, and it is available as . 1. and 2. I was only checking that I understood the implications and I agree that what you are proposing is good 👍 |
According to my experiment now, we must enable "auto publishing", otherwise the new deploy generated by Github Action can't be the latest "Production build". |
with: | ||
publish-dir: "docs/.vitepress/dist" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
production-deploy: ${{ startsWith(github.ref, 'refs/tags/v') }} |
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.
This will also match for beta releases, no? That we wanted to avoid
https://github.com/vitejs/vite/releases/tag/v2.9.0-beta.11
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.
yes,maybe a more specific regular expression ..
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.
@patak-dev Maybe a clearer definition of our requirements about branch/tag name ?
- Starts with "v"
- Not contains "beta" (or something else ?)
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.
Yes, starts with v
and not includes beta
covers it 👍🏼
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 use contains
which is defined as built-in function @patak-dev
( docs: https://docs.github.com/en/actions/learn-github-actions/expressions#contains )
@ShenQingchuan I just saw that netlify auto-deploys now has a fixed URL for main: This is great, as we can use it to check the current HEAD state and as temporal docs during the beta. Maybe we should check that this PR isn't going to disable this feature, or improve on it by directly deploying on every commit to main.vitejs.dev? |
Yes, that's another awesome feature of Netlify that I didn't know ! Does it means that: Right now we already have a url to preview our latest docs ? |
Yes, check https://main--vitejs.netlify.app/! 🙌🏼 |
I found specification about it in Netlify docs, but it seems need to require auto build from a branch. but for But I've got your idea about |
@patak-dev Maybe we can merge this PR first ? I haven't found any good idea to "Enable auto publishing main branch to This is also important:
|
I think we are close to moving forward to test it. I found another issue though. We release patches from prev minors so if we tag 2.9.3 -> 2.8.7, we'll end up with stale docs because it will trigger a new deployment. So we need to check that the tag is from the main branch? Or maybe I'm missing something 🤔 @ShenQingchuan another thing that we should think about is how we could deploy to deploy a |
@antfu is using https://docs.netlify.com/domains-https/custom-domains/multiple-domains/#branch-subdomains for VueUse, so there is deploy with the last version for each major: https://v6-7-6.vueuse.org/. In Vite it is usual to apply patches to older versions, so it would be better to have a https://v2.vitejs.dev. Maybe we could still use it and for the last minor in each major we tag it as |
Do we still want to go ahead with this? I believe we have disabled auto publishing, but we still manually trigger publishing when we cut a release, and this PR automates it? |
I think the problem this PR tried to resolve is staled, so it's closable now. |
Automatic workflow for release docs publish
I wrote these guides in order to give our reviewers more context and information here.
Why for this PR ?
After publishing a new release of Vite, we must open Netlify UI to trigger docs build & publish manually now.
It's because the contents of
docs
folder are actively updating, and we'll always see the latest content on docs site if we use Netlify's git-based deployment, but actually there's something ahead of current release.So I'm wondering if there's some ways for setting up an automatically deploy workflow which only targets on
vX.X.X
tag, it's a significant sign.Is these changes enough ?
Actually, NO. we should add more configs around.
First: turn off Netlify builds
Since now this repo would not trigger a new deploy by commit pushing, we can skip this step if it's already done.
Site Setting
panelBuild & Deploy
tab on the left sideBuild Settings
, and clickEdit Settings
Builds --> Stop Builds
Second: setting up secrets
This step may requires @yyx990803, @patak-dev or someone has right to access this repo's setting panel, to create a list of following fields:
VITE_GITHUB_TOKEN
: this is a Github Access Token, may need to be generated by manually creating @yyx990803https://github.com/settings/tokens
NETLIFY_AUTH_TOKEN
: this is a personal access token which is supposed to be generate on Netlify.https://app.netlify.com/user/applications#personal-access-tokens
NETLIFY_SITE_ID
: this one could be found at General | Site settingsBut I could use an open API of Netlify to query for result:
That's all for configuration.