Skip to content

Daily Visual Test

Daily Visual Test #177

Workflow file for this run

name: Daily Visual Test
on:
schedule:
- cron: '00 23 * * *' # Runs at midnight UTC every day
permissions:
contents: read
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: Initialize Node.js
if: steps.today.outputs.has_commits == 'true'
uses: ./.github/actions/init-node
- name: Publish to Chromatic
if: steps.today.outputs.has_commits == 'true'
uses: chromaui/action@v11
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: build:visual
workingDir: web/
exitZeroOnChanges: true