Jobber/.github/workflows/docs-version.yml
Shaheer Sarfaraz 1f929dfc7f
Create the setup for the documentation page (#171)
* don't run for generated docusaurus

* format

* workflow to autoupdate docs version

* fix versioning

* add link back to app

* remove old docs

* html link???

* don't track .docusaurus

* documantation build
2026-02-15 22:50:52 +00:00

63 lines
1.6 KiB
YAML

name: docs-version
on:
push:
tags: ["v*"]
permissions:
contents: write
concurrency:
group: docs-version-${{ github.ref }}
cancel-in-progress: true
jobs:
version-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci --workspaces --include-workspace-root
working-directory: .
- name: Derive docs version from tag
id: vars
run: |
VERSION="${GITHUB_REF_NAME#v}"
if [ -z "$VERSION" ]; then
echo "Unable to derive version from tag '$GITHUB_REF_NAME'" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Generate docs version
run: npm run docs:version -- "${{ steps.vars.outputs.version }}"
working-directory: .
- name: Commit and push generated docs version files
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs-site/versions.json docs-site/versioned_docs docs-site/versioned_sidebars
if git diff --cached --quiet; then
echo "No docs version changes detected; skipping commit."
exit 0
fi
git commit -m "docs: cut version ${{ steps.vars.outputs.version }}"
git push origin HEAD:main