Skip to content

Commit

Permalink
Merge pull request #46 from Danil-Grigorev/docs-versioning-automated
Browse files Browse the repository at this point in the history
✨Docs versioning, automated
  • Loading branch information
richardcase authored Oct 10, 2023
2 parents 17c9584 + 5656156 commit 0933087
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/version-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish new docs version

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
TAG: ${{ github.ref_name }}

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare the tag
run: echo "TAG=${TAG#v}" >> $GITHUB_ENV
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Create a new version
run: yarn docusaurus docs:version ${{ env.TAG }}
- uses: EndBug/add-and-commit@v9
with:
message: 'Add docs version ${{ env.TAG }}'
push: false
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ $ yarn build

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Versioning

This project follows docusaurus [versioning](https://docusaurus.io/docs/versioning#configuring-versioning-behavior) guidelines, including the process of [archiving](https://docusaurus.io/docs/versioning#keep-the-number-of-versions-small) the old versions.

### Deployment

Using SSH:
Expand Down
13 changes: 12 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ const config = {
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
versions: {
current: {
label: 'Next 🚧',
badge: false,
},
},
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
Expand Down Expand Up @@ -79,7 +85,12 @@ const config = {
},
{ to: '/blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/rancher-sandbox/rancher-turtles-docs',
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true,
},
{
href: 'https://github.com/rancher-sandbox/rancher-turtles-doc',
label: 'GitHub',
position: 'right',
},
Expand Down

0 comments on commit 0933087

Please sign in to comment.