feat: adding metadata grouper component #2824
Workflow file for this run
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: Sync docs with Readme | |
on: | |
pull_request: | |
paths: | |
- "docs/pydoc/**" | |
push: | |
branches: | |
- main | |
# release branches have the form v1.9.x | |
- "v[0-9]+.[0-9]+.x" | |
# Exclude 1.x release branches, there's another workflow handling those | |
- "!v1.[0-9]+.x" | |
env: | |
HATCH_VERSION: "1.13.0" | |
PYTHON_VERSION: "3.10" | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "${{ env.PYTHON_VERSION }}" | |
- name: Install Hatch | |
run: pip install hatch==${{ env.HATCH_VERSION }} | |
- name: Generate API docs | |
env: | |
# This is necessary to fetch the documentation categories | |
# from Readme.io as we need them to associate the slug | |
# in config files with their id. | |
README_API_KEY: ${{ secrets.README_API_KEY }} | |
# The command is a bit misleading, we're not actually syncing anything here, | |
# we're just generating the markdown files from the yaml configs. | |
run: hatch run readme:sync | |
- name: Get version | |
id: version-getter | |
run: | | |
VERSION="$(hatch version | cut -d '.' -f 1,2)" | |
CURRENT_BRANCH="${{ github.ref_name }}" | |
# If we're on `main` branch we should push docs to the unstable version | |
if [ "$CURRENT_BRANCH" = "main" ]; then | |
VERSION="$VERSION-unstable" | |
fi | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
- name: Sync docs | |
if: github.event_name == 'push' | |
uses: readmeio/rdme@v8 | |
with: | |
rdme: docs ./docs/pydoc/temp --key=${{ secrets.README_API_KEY }} --version=${{ steps.version-getter.outputs.version }} | |
- name: Delete outdated | |
if: github.event_name == 'push' | |
env: | |
README_API_KEY: ${{ secrets.README_API_KEY }} | |
run: hatch run readme:delete-outdated --version="${{ steps.version-getter.outputs.version }}" --config-path ./docs/pydoc/config |