woocommerce-rest-api-docs/.github/workflows/deploy.yml
Brian Coords 9716c70548 Add markdown endpoints for AI coding agents
Generate lightweight markdown versions of the API documentation that are
more suitable for AI coding agents and LLMs. The current HTML output is
~4.2MB which is heavy for agents to process.

- Add build-markdown.sh script that parses YAML front matter and
  concatenates includes into single markdown files
- Update deploy workflow to generate markdown after Slate build
- Output files: index.md, wp-api-v1.md, wp-api-v2.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 19:48:34 -07:00

39 lines
852 B
YAML

name: Deploy on push
on:
push:
branches:
- trunk
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
if: github.repository_owner == 'woocommerce'
name: Build and deploy
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
run: ./build.sh
- name: Generate markdown for AI agents
run: ./build-markdown.sh
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4