diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a9de6970 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: Build + +on: + pull_request: + branches: + - main + - stage + push: + branches: + - main + - stage + +permissions: + contents: read + +jobs: + build: + name: Build packages + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22.14.0" + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build + + - name: Check for file changes + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "::error::Build generated file changes that are not committed. Please build locally and commit the changes." + git --no-pager diff + git --no-pager diff --stat + exit 1 + fi