feat: use branch name instead of tag for stable docs (#32614)
* feat: use branch name instead of tag for stable docs Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com> * test Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com> * paginate everything Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com> * different return value Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com> * update both flows Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com> * add docs Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com> * Change checkout ref from tags to heads Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com> --------- Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com> Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>
This commit is contained in:
@@ -27,36 +27,37 @@ jobs:
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: find latest release
|
||||
- name: find latest release branch
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
|
||||
id: find-release
|
||||
with:
|
||||
script: |
|
||||
const { data } = await github.rest.repos.listTags({
|
||||
const data = await octokit.paginate(github.rest.repos.listBranches, {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
per_page: 100,
|
||||
})
|
||||
|
||||
const [{tag}] = data
|
||||
const [{branch}] = data
|
||||
.map(i => i.name)
|
||||
.filter(tag => tag.match(/^v\d+\.\d+\.\d+$/))
|
||||
.map(tag => ({
|
||||
tag,
|
||||
val: tag
|
||||
.filter(branch => branch.match(/^patch\/v\d+\.\d+\.\d+$/))
|
||||
.map(branch => ({
|
||||
branch,
|
||||
val: branch
|
||||
.split('/')[1]
|
||||
.slice(1)
|
||||
.split('.')
|
||||
.reduce((val, part) => Number(val) * 1000 + Number(part))
|
||||
}))
|
||||
.sort((a, b) => b.val - a.val)
|
||||
|
||||
return tag
|
||||
return branch
|
||||
result-encoding: string
|
||||
|
||||
- name: checkout latest release
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: refs/tags/${{ steps.find-release.outputs.result }}
|
||||
ref: refs/heads/${{ steps.find-release.outputs.result }}
|
||||
|
||||
- name: Use Node.js 22.x
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
@@ -232,7 +233,7 @@ jobs:
|
||||
- name: checkout latest release
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: refs/tags/${{ needs.stable.outputs.release }}
|
||||
ref: refs/heads/${{ needs.stable.outputs.release }}
|
||||
|
||||
- name: microsite yarn install
|
||||
run: yarn install --immutable
|
||||
|
||||
@@ -32,36 +32,37 @@ jobs:
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: find latest release
|
||||
- name: find latest release branch
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
|
||||
id: find-release
|
||||
with:
|
||||
script: |
|
||||
const { data } = await github.rest.repos.listTags({
|
||||
const data = await octokit.paginate(github.rest.repos.listBranches, {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
per_page: 100,
|
||||
})
|
||||
|
||||
const [{tag}] = data
|
||||
const [{branch}] = data
|
||||
.map(i => i.name)
|
||||
.filter(tag => tag.match(/^v\d+\.\d+\.\d+$/))
|
||||
.map(tag => ({
|
||||
tag,
|
||||
val: tag
|
||||
.filter(branch => branch.match(/^patch\/v\d+\.\d+\.\d+$/))
|
||||
.map(branch => ({
|
||||
branch,
|
||||
val: branch
|
||||
.split('/')[1]
|
||||
.slice(1)
|
||||
.split('.')
|
||||
.reduce((val, part) => Number(val) * 1000 + Number(part))
|
||||
}))
|
||||
.sort((a, b) => b.val - a.val)
|
||||
|
||||
return tag
|
||||
return branch
|
||||
result-encoding: string
|
||||
|
||||
- name: checkout latest release
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: refs/tags/${{ steps.find-release.outputs.result }}
|
||||
ref: refs/heads/${{ steps.find-release.outputs.result }}
|
||||
|
||||
- name: Use Node.js 22.x
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
|
||||
@@ -13,6 +13,7 @@ This website was created with [Docusaurus](https://docusaurus.io/).
|
||||
- [Editing Content](#editing-content)
|
||||
- [Adding Content](#adding-content)
|
||||
- [Full Documentation](#full-documentation)
|
||||
- [How to patch the stable docs](#patching-the-docs)
|
||||
|
||||
# Getting Started
|
||||
|
||||
@@ -240,3 +241,7 @@ Full documentation can be found on the [Docusaurus website](https://docusaurus.i
|
||||
A feedback widget is provided by the `docusaurus-pushfeedback` plugin, which connects to the https://pushfeedback.com service. Styling of the button is configured in `microsite/src/theme/customTheme.scss`, while the plugin itself is configured in `microsite/docusaurus.config.js`.
|
||||
|
||||
Feedback submissions are connected to an account owned by @Rugvip and are available on request, reach out to @Rugvip on [Discord](https://discord.gg/backstage-687207715902193673).
|
||||
|
||||
# Patching the docs
|
||||
|
||||
To patch the documentation for the stable version, you can submit a PR to the correct `patch/v<version>` branch. For example, if `1.48.0` is the stable version, you would submit a fix to the branch `patch/v1.48.0`. Once your fix is in, you can trigger the `deploy_microsite` GH action (or wait until the next run on master) and you should see the fix on the stable version at https://backstage.io/docs.
|
||||
|
||||
Reference in New Issue
Block a user