Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create pipeline to build cookbooks #388

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
72 changes: 72 additions & 0 deletions .github/workflows/build-cookbooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: generate-mdx-files

on:
pull_request:
branches:
- main
paths:
- 'fern/pages/cookbooks/**/*.mdx'
- 'scripts/build-cookbooks/**/*'

jobs:
run:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Poetry
shell: bash
run: |
pipx install poetry


- name: Install Project Dependencies with Poetry
shell: bash
run: |
poetry install

# - name: Run mypy
# id: check_mypy
# run: |
# if grep -q 'mypy' pyproject.toml; then
# echo "mypy is specified in pyproject.toml, running..."
# poetry run mypy .
# echo "mypy_run=true" >> $GITHUB_ENV
# else
# echo "mypy is not specified in pyproject.toml, exiting."
# echo "mypy_run=false" >> $GITHUB_ENV
# fi
# shell: bash

- name: Build Cookbooks MDX Files
#if: env.mypy_run == 'true'
run: poetry run python scripts/build-cookbooks/build.py
shell: bash

- name: Check for Changes
id: check_changes
shell: bash
run: |
git add fern/pages/cookbooks* # Ensure this path is correct
git diff --cached --exit-code || echo "::set-output name=changes_detected::true"
continue-on-error: true

- name: Commit and Push Changes
if: steps.check_changes.outputs.changes_detected == 'true'
shell: bash
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git commit -m "Update cookbooks"
git push origin HEAD:refs/heads/${{ github.head_ref }}
357 changes: 205 additions & 152 deletions fern/pages/cookbooks/agent-api-calls.mdx

Large diffs are not rendered by default.

384 changes: 217 additions & 167 deletions fern/pages/cookbooks/agent-short-term-memory.mdx

Large diffs are not rendered by default.

Loading
Loading