Skip to content

Commit

Permalink
ci: enhance docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc committed Feb 9, 2025
1 parent 0672790 commit e2b71a4
Show file tree
Hide file tree
Showing 6 changed files with 20,692 additions and 13,446 deletions.
70 changes: 52 additions & 18 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
name: Deploy to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- main
- docs-test
paths:
- 'docs/**'
- '.github/workflows/publish-docs.yaml'
pull_request:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/publish-docs.yaml'

permissions:
contents: read
Expand All @@ -15,35 +26,58 @@ concurrency:
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Build job
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: 'docs/package-lock.json'
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Install dependencies
working-directory: docs
run: yarn install --frozen-lockfile
- name: Build website
working-directory: docs
run: yarn build
run: npm ci

- name: Test build
run: |
npm run build
- name: Upload pages artifact
uses: actions/upload-artifact@v4
with:
name: github-pages-build
path: docs/build/*

# Deploy job
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: ${{ github.ref == 'refs/heads/main' && 'github-pages' || 'preview' }}
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Clean deployment directory
run: rm -rf artifact && mkdir artifact

- name: Download build
uses: actions/download-artifact@v4
with:
name: github-pages-build
path: artifact

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs/build'
path: artifact

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v3
2 changes: 1 addition & 1 deletion docs/docs/modules/agents/executor/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sidebar_position: 2

import CodeBlock from "@theme/CodeBlock";
import Example from "@examples/mrkl-agent-example/mrkl_agent.go";
import DocCardList from "@theme/DocCardList";

# Agent Executors

Expand All @@ -18,5 +19,4 @@ To make agents more powerful we need to make them iterative, ie. call the model
An example that initialize a MRKL (Modular Reasoning, Knowledge and Language, pronounced "miracle") agent executor.
<CodeBlock language="go">{Example}</CodeBlock>

import DocCardList from "@theme/DocCardList";
<DocCardList />
6 changes: 4 additions & 2 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const { ProvidePlugin } = require("webpack");
const path = require("path");
const lightCodeTheme = require('prism-react-renderer').themes.github;
const darkCodeTheme = require('prism-react-renderer').themes.dracula;

const examplesPath = path.resolve(__dirname, "..", "examples");

Expand Down Expand Up @@ -124,8 +126,8 @@ const config = {
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
prism: {
theme: require("prism-react-renderer/themes/vsLight"),
darkTheme: require("prism-react-renderer/themes/vsDark"),
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
image: "img/parrot-chainlink-icon.png",
navbar: {
Expand Down
Loading

0 comments on commit e2b71a4

Please sign in to comment.