From 8415e9fcdd613c658e1ce4b0b0d7b43874466581 Mon Sep 17 00:00:00 2001 From: Peter Makowski Date: Fri, 26 Apr 2024 12:02:14 +0200 Subject: [PATCH] ci: setup bundle size action --- .github/workflows/bundle-size.yml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/bundle-size.yml diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml new file mode 100644 index 0000000000..40db5dceb0 --- /dev/null +++ b/.github/workflows/bundle-size.yml @@ -0,0 +1,34 @@ +name: Bundle Size + +on: + push: + branches: + - ci-bundle-size-action + pull_request: + branches: + - main + +jobs: + bundle-size: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Restore node_modules + id: yarn-cache + uses: actions/cache@v4 + with: + path: "**/node_modules" + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Use Node.js from .nvmrc + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + - name: Install + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: CYPRESS_INSTALL_BINARY=0 yarn install + - name: Build assets + run: yarn build + - uses: preactjs/compressed-size-action@v2 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + clean-script: "clean"