Skip to content

Visual Test

Visual Test #89

Workflow file for this run

name: Daily Visual Test
on:
schedule:
- cron: '00 23 * * *' # Runs at midnight UTC every day
jobs:
chromatic:
name: Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for today commits
id: today
run: |
today=$(date -u +"%Y-%m-%d")
last_commit_date=$(git log -1 --format=%cd --date=short)
if [ "$today" == "$last_commit_date" ]; then
echo "has_commits=true" >> "$GITHUB_OUTPUT"
else
echo "has_commits=false" >> "$GITHUB_OUTPUT"
echo "No commits today. Stopping the workflow."
fi
- name: Install tools from asdf config
if: steps.today.outputs.has_commits == 'true'
uses: ai/asdf-cache-action@v1
- name: Install dependencies
if: steps.today.outputs.has_commits == 'true'
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Publish to Chromatic
if: steps.today.outputs.has_commits == 'true'
uses: chromaui/action@v10
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: build:visual
workingDir: web/
exitZeroOnChanges: true