From 9c8ca123ee269fc9bece5c72bb4da0a806e5e79e Mon Sep 17 00:00:00 2001 From: lorenzodagostinoradicalbit Date: Wed, 19 Jun 2024 17:47:38 +0200 Subject: [PATCH] docs: managed doc version via release please --- .github/release-config.json | 3 ++- .github/workflows/docs-workflow.yml | 11 +++++++++-- docs/docusaurus.config.js | 6 +++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/release-config.json b/.github/release-config.json index 914dd41a..8c197d0d 100644 --- a/.github/release-config.json +++ b/.github/release-config.json @@ -10,7 +10,8 @@ }, "api/pyproject.toml", "sdk/pyproject.toml", - "spark/pyproject.toml" + "spark/pyproject.toml", + "docs/docusaurus.config.js" ] } } diff --git a/.github/workflows/docs-workflow.yml b/.github/workflows/docs-workflow.yml index e61d9ae9..19b71f37 100644 --- a/.github/workflows/docs-workflow.yml +++ b/.github/workflows/docs-workflow.yml @@ -20,6 +20,9 @@ jobs: build: name: Build Docusaurus runs-on: ubuntu-22.04 + defaults: + run: + working-directory: ./docs steps: - uses: actions/checkout@v4 with: @@ -42,7 +45,12 @@ jobs: deploy: name: Deploy to GitHub Pages - needs: build + needs: [build] + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: ./docs # Grant GITHUB_TOKEN the permissions required to make a Pages deployment permissions: @@ -54,7 +62,6 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-22.04 steps: - name: Deploy to GitHub Pages id: deployment diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 2f0753ff..99c8ed0d 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -6,6 +6,10 @@ import {themes as prismThemes} from 'prism-react-renderer'; +// x-release-please-start-version +const VERSION = '0.8.0'; +// x-release-please-end + /** @type {import('@docusaurus/types').Config} */ const config = { title: 'Radicalbit AI Monitoring', @@ -46,7 +50,7 @@ const config = { lastVersion: 'current', versions: { current: { - label: '0.8.0', + label: VERSION, path: '/', }, },