ci: generate docs from the contract source #2
Workflow file for this run
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: Generated Files are Updated | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**" | |
| pull_request: | |
| branches: | |
| - "**" | |
| paths: | |
| - "**" | |
| types: | |
| - synchronize | |
| - opened | |
| - reopened | |
| - ready_for_review | |
| defaults: | |
| run: | |
| working-directory: . | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "21.1.0" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Generate docs | |
| run: | | |
| export LC_ALL=C | |
| yarn docs | |
| - name: Check for changes | |
| run: | | |
| if git diff --exit-code --ignore-space-change --ignore-all-space --ignore-cr-at-eol -- docs; then | |
| echo "Generated docs are up-to-date." | |
| else | |
| echo "::error::Generated docs are not up-to-date. Please run 'yarn docs' locally and commit any changes." | |
| exit 1 | |
| fi |