Merge pull request #9 from VectorInstitute/create_schema #4
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: sync-readme | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'README.md' | |
| - 'scripts/sync_readme_to_docs.py' | |
| - '.github/workflows/sync_readme.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'README.md' | |
| - 'scripts/sync_readme_to_docs.py' | |
| - '.github/workflows/sync_readme.yml' | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| sync-readme: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/[email protected] | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.6.13" | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: uv sync --dev --group docs | |
| - name: Run sync script | |
| run: python scripts/sync_readme_to_docs.py | |
| - name: Check for changes | |
| id: git-check | |
| run: | | |
| git diff --quiet docs/index.md || echo "changes=true" >> $GITHUB_OUTPUT | |
| - name: Setup Git | |
| if: steps.git-check.outputs.changes == 'true' && github.event_name == 'push' | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| - name: Commit changes | |
| if: steps.git-check.outputs.changes == 'true' && github.event_name == 'push' | |
| run: | | |
| git add docs/index.md | |
| git commit -m "docs: sync README.md reference implementations to docs/index.md | |
| Automated update triggered by changes to README.md | |
| [skip ci]" | |
| git push | |
| - name: Comment on PR | |
| if: steps.git-check.outputs.changes == 'true' && github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '✅ The reference implementations table has been updated in the PR preview. Changes will be automatically committed to docs/index.md when merged.' | |
| }) | |
| - name: Build docs for preview | |
| if: github.event_name == 'pull_request' | |
| run: uv run mkdocs build --clean | |
| - name: Upload preview artifact | |
| if: github.event_name == 'pull_request' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-preview | |
| path: site/ | |
| retention-days: 1 |