Merge pull request #2300 from cachix/changelogs #5791
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: "Generate docs/examples" | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| generate-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| extra_nix_config: | | |
| access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
| - uses: cachix/cachix-action@v16 | |
| with: | |
| name: devenv | |
| - name: Install devenv | |
| run: nix profile install . -L --accept-flake-config | |
| - name: Disable git-hooks | |
| run: | | |
| echo '{ git-hooks.default_stages = ["manual"]; }' > devenv.local.nix | |
| - name: Generate doc options | |
| working-directory: docs/gen | |
| run: devenv shell devenv-generate-doc-options | |
| - uses: EndBug/add-and-commit@v9 | |
| if: ${{ github.event_name == 'push' }} | |
| with: | |
| default_author: github_actions | |
| add: docs/src/reference/options.md | |
| message: "Auto generate docs/src/reference/options.md" | |
| - name: Generate docs | |
| working-directory: docs/gen | |
| run: | | |
| devenv shell devenv-generate-docs | |
| devenv shell devenv-verify-individual-docs | |
| devenv shell devenv-generate-individual-docs | |
| - uses: EndBug/add-and-commit@v9 | |
| if: ${{ github.event_name == 'push' }} | |
| with: | |
| default_author: github_actions | |
| add: docs | |
| message: "Auto generate missing individual markdowns" | |
| - name: Generate supported-languages example | |
| run: devenv shell devenv-generate-languages-example | |
| - uses: EndBug/add-and-commit@v9 | |
| if: ${{ github.event_name == 'push' }} | |
| with: | |
| default_author: github_actions | |
| add: examples/supported-languages/devenv.nix | |
| message: "Auto-generate supported languages example" | |
| - name: Generate JSON schema | |
| run: devenv generate-json-schema | |
| - uses: EndBug/add-and-commit@v9 | |
| if: ${{ github.event_name == 'push' }} | |
| with: | |
| default_author: github_actions | |
| add: docs/src/devenv.schema.json | |
| message: "Auto generate docs/src/devenv.schema.json" | |
| - name: Check for uncommitted changes | |
| run: | | |
| diff=$(git diff --stat) | |
| if [[ -n "$diff" ]]; then | |
| message="There are uncommitted doc changes in the repository. | |
| ${diff} | |
| To resolve this, you can: | |
| a. Run the failing devenv-generate-* commands locally and commit the changes. | |
| b. Let CI auto-commit the changes to your fork of the repo. You may need to enable this workflow on your fork." | |
| echo "::error::${message//$'\n'/%0A}" | |
| exit 1 | |
| else | |
| echo "No uncommitted doc changes found." | |
| fi |