Skip to content

Merge pull request #1122 from chromaui/revert-1121-revert-1112-tom/ca… #58

Merge pull request #1122 from chromaui/revert-1121-revert-1112-tom/ca…

Merge pull request #1122 from chromaui/revert-1121-revert-1112-tom/ca… #58

name: Chromatic Package Size Update
on:
push:
branches:
- main
permissions:
contents: read
jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: lts/*
- run: corepack enable
- name: install
run: yarn install --immutable
- name: build
run: yarn build
- name: Remove Sourcemaps
run: |
yarn clean:sourcemaps
- name: Get Package Size
id: package_size
run: |
export DIST_SIZE="$(du -k ./dist | cut -f1)"
echo "Package Size: $DIST_SIZE KB"
echo "size=$DIST_SIZE" >> "$GITHUB_OUTPUT"
- name: Update Database
run: |
curl "${{ secrets.UPSTASH_REDIS_REST_URL }}/set/$GITHUB_SHA/${{ steps.package_size.outputs.size }}" -H "Authorization: Bearer ${{ secrets.UPSTASH_API_KEY }}"