Skip to content

Build context artifacts #59

Build context artifacts

Build context artifacts #59

Workflow file for this run

name: Build context artifacts
on:
schedule:
# Every 6 hours — keeps artifacts fresh without hammering the API
- cron: '0 */6 * * *'
workflow_dispatch:
push:
branches: [main]
paths:
- 'dataciviclab.config.yml'
- 'src/**'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install
run: pip install -e .
- name: Build context artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
agent-context build \
--config dataciviclab.config.yml \
--out generated/ \
--github-token "$GITHUB_TOKEN"
- name: Publish to context branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Publish generated/ to the context branch via a regular (non-force) push.
# Agents and the lab-workspace MCP can read from:
# https://raw.githubusercontent.com/dataciviclab/agent-context-builder/context/session_bootstrap.md
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Check out context branch if it exists, otherwise create it
git fetch origin context 2>/dev/null && git checkout context || git checkout --orphan context
# Replace content with freshly generated artifacts
git rm -rf . --quiet 2>/dev/null || true
cp -r generated/. .
git add session_bootstrap.md workspace_triage.json topic_index.json
git commit -m "context: $(date -u +%Y-%m-%dT%H:%M:%SZ) [skip ci]"
git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" context