Merge branch 'main' of github.com:NixRTR/docs #2
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 and Commit dist/ | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/**' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'vite.config.ts' | |
| - 'tsconfig*.json' | |
| - 'tailwind.config.js' | |
| - 'postcss.config.js' | |
| - 'scripts/**' | |
| - 'public/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build React docs | |
| env: | |
| VITE_BASE_PATH: /docs/ | |
| run: npm run build | |
| - name: Check for changes | |
| id: check-changes | |
| run: | | |
| git add dist/ | |
| if git diff --cached --quiet; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| git reset | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| git reset | |
| fi | |
| - name: Commit dist/ | |
| if: steps.check-changes.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add dist/ | |
| git commit -m "chore: update dist/ build [skip ci]" | |
| git push | |