Repository navigation
Refresh daily documentation #33
This file contains hidden or 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
| name: Refresh daily documentation | |
| # Only the OpenCode V2 and Effect v4 docsets publish on a schedule. The | |
| # remaining docsets are kept in the repository for on-demand runs by | |
| # scrape.yml. | |
| on: | |
| schedule: | |
| - cron: "23 5 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: refresh-daily-docs | |
| cancel-in-progress: false | |
| jobs: | |
| refresh: | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 2 | |
| matrix: | |
| docset: | |
| - opencode-v2 | |
| - effect-v4 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.14 | |
| - run: bun install --frozen-lockfile | |
| - name: Scrape ${{ matrix.docset }} | |
| run: bun run scrape-docs:${{ matrix.docset }} | |
| - name: Publish ${{ matrix.docset }} | |
| env: | |
| DOCS_REPO_KEYS: ${{ secrets.DOCS_REPO_KEYS }} | |
| DOCSET: ${{ matrix.docset }} | |
| run: | | |
| install -m 700 -d ~/.ssh | |
| jq -r --arg docset "$DOCSET" '.[$docset]' <<< "$DOCS_REPO_KEYS" > ~/.ssh/id_ed25519 | |
| test -s ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| git clone "git@github.com:birbprophet/scraped-docs-${DOCSET}.git" .publish | |
| rsync -a --delete --exclude=.git/ "docs/deps/${DOCSET}/" .publish/ | |
| git -C .publish add --all | |
| bun run scraper/discard-timestamp-only-changes.ts .publish | |
| cd .publish | |
| if git diff --cached --quiet; then | |
| echo "No documentation changes" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git commit -m "docs: refresh ${DOCSET}" | |
| git push |