Prepare Docs for next release #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Prepare Docs for next release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "The next version we're going to release (must be in the form vX.Y.Z)" | |
required: true | |
default: 'v1.0.0' | |
release-branch: | |
description: "The name of the release branch where we'll create the new Docusaurus documentation versioned" | |
required: true | |
default: 'release-please--branches--main' | |
jobs: | |
run-versioning-command: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: ./docs | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: '${{ github.event.inputs.release-branch }}' | |
- name: Validate version input | |
id: validate_version | |
run: | | |
echo "VERSION: ${{ github.event.inputs.version }}" | |
if [[ ! "${{ github.event.inputs.version }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "Invalid version format. Must be 'vX.Y.Z'" | |
exit 1 | |
fi | |
- name: Validate release-branch input | |
id: validate_release-branch | |
run: | | |
echo "RELEASE_BRANCH: ${{ github.event.inputs.release-branch }}" | |
if [[ "${{ github.event.inputs.release-branch }}" != "release-please--branches--main" ]]; then | |
echo "Invalid release branch. Must be 'release-please--branches--main'" | |
exit 1 | |
fi | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: docs/yarn.lock | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Run Docusaurus version command | |
run: npm run docusaurus docs:version ${{ github.event.inputs.version }} | |
- name: Commit versioned docs change | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
branch: ${{ github.event.inputs.release-branch }}" | |
commit_message: "docs: added ${{ github.event.inputs.version }} version to docs" |