Update docs #190
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
on: | |
schedule: | |
- cron: "0 5 * * 1" # run every Monday day at 5AM | |
workflow_dispatch: {} # allow running manually from the github ui | |
name: Update docs | |
jobs: | |
update_docs: | |
name: Update docs | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- run: npm install jsdoc-to-markdown | |
- run: pip install wheel pip -U --break-system-packages | |
- run: pip install -r requirements.txt -U --break-system-packages | |
- run: pip install duckdb --pre -U --break-system-packages # grab the latest duckdb python dev version | |
- uses: actions/checkout@v4 | |
with: | |
path: 'duckdb' | |
repository: 'duckdb/duckdb' | |
- uses: actions/checkout@v4 | |
with: | |
path: 'duckdb-node' | |
repository: 'duckdb/duckdb-node' | |
- name: Download latest duckdb cli binary | |
run: | | |
RUN_ID=$(gh run list --branch main --repo duckdb/duckdb --workflow LinuxRelease -q '.[] | select(.conclusion == "success").databaseId' --json conclusion,databaseId | head -n 1) | |
gh run download $RUN_ID --repo duckdb/duckdb --name duckdb-binaries-linux | |
mkdir -p duckdb/build/release | |
unzip duckdb_cli-linux-amd64.zip -d duckdb/build/release | |
- name: Generate docs | |
run: | | |
./scripts/generate_all_docs.sh duckdb | |
# remove things we don't want committed | |
rm *.zip | |
rm -rf duckdb duckdb-node | |
- name: Send PR | |
run: | | |
git add --all . | |
git checkout -B auto_update_docs | |
git config user.email "[email protected]" | |
git config user.name "Quack Mc Docs" | |
git commit -m "chore: update docs" | |
git push -f origin auto_update_docs | |
# Store the PAT in a file that can be accessed by the | |
# GitHub CLI. | |
echo "${{ secrets.GH_UPDATE_DOCS_TOKEN }}" > token.txt | |
# Authorize GitHub CLI for the current repository and | |
# create a pull-requests containing the updates. | |
gh auth login --with-token < token.txt | |
gh pr create \ | |
--body "" \ | |
--title "chore: update DuckDB docs" \ | |
--head "auto_update_docs" \ | |
--base "main" |