Merge pull request #56 from microsoft/bug_fixes #18
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 Docs | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: flowquery-docs-${{ github.ref_name }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install root dependencies | |
| run: npm ci | |
| - name: Install flowquery-app dependencies | |
| working-directory: flowquery-app | |
| run: npm ci | |
| - name: Clean Vite output | |
| run: rm -rf docs/assets docs/index.html | |
| - name: Build docs app | |
| working-directory: flowquery-app | |
| run: npm run build | |
| - name: Commit docs changes | |
| env: | |
| HUSKY: "0" | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/ | |
| if git diff --staged --quiet; then | |
| exit 0 | |
| fi | |
| git commit -m "chore: rebuild docs [skip ci]" | |
| for attempt in 1 2 3; do | |
| git fetch origin main:refs/remotes/origin/main | |
| if ! git rebase origin/main; then | |
| git rebase --abort || true | |
| elif git push origin HEAD:main; then | |
| break | |
| fi | |
| if [ "$attempt" -eq 3 ]; then | |
| echo "Failed to push docs rebuild after 3 attempts." | |
| exit 1 | |
| fi | |
| sleep 5 | |
| done |