add faq script section, faq eos40d (#1411) #13
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: Build FAQ site | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| paths: | |
| - 'docs/**' | |
| - 'assets/**' | |
| - 'mkdocs_remote.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.x' | |
| - name: Install MkDocs and pre-commit | |
| run: pip install mkdocs pre-commit | |
| - name: Build docs into faq | |
| run: mkdocs build --config-file mkdocs_remote.yml --site-dir faq | |
| - name: Run pre-commit | |
| run: | | |
| pre-commit run --all-files || true | |
| - name: Commit built FAQ | |
| id: commit | |
| run: | | |
| if git status --porcelain faq | grep -q .; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add faq | |
| git commit -m "chore: build FAQ site [skip ci]" | |
| echo "created=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "created=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Push changes to dev | |
| if: steps.commit.outputs.created == 'true' | |
| run: git push origin dev |