Skip to content

Chromatic

Chromatic #18

Workflow file for this run

name: Chromatic
on:
schedule:
- cron: '0 8 * * *' # Runs daily at 8am UTC
workflow_dispatch: # Allow manual triggering for testing
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: check latest commit is less than a day
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should_run=false" >> $GITHUB_OUTPUT
chromatic:
name: Run Chromatic
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.1.33"
- name: Install dependencies
run: bun install
- name: Run Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}