Update build #53
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: Build and Commit Dist | |
| on: | |
| push: | |
| paths-ignore: | |
| - '**.md' | |
| - 'README' | |
| - 'docs/**' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Check for NOBUILD in commit message | |
| id: check_nobuild | |
| run: | | |
| COMMIT_MSG=$(git log -1 --pretty=%B) | |
| if echo "$COMMIT_MSG" | grep -q "NOBUILD"; then | |
| echo "NOBUILD found in commit message. Skipping build." | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "skip=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Setup Node.js | |
| if: steps.check_nobuild.outputs.skip != 'true' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| if: steps.check_nobuild.outputs.skip != 'true' | |
| run: yarn install --frozen-lockfile | |
| - name: Build project | |
| if: steps.check_nobuild.outputs.skip != 'true' | |
| run: yarn build | |
| - name: Commit and push dist directory | |
| if: steps.check_nobuild.outputs.skip != 'true' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add dist/ | |
| git commit -m "Build $(git rev-parse --short HEAD)" || echo "No changes to commit" | |
| git push |