-
Notifications
You must be signed in to change notification settings - Fork 37
37 lines (37 loc) · 1.16 KB
/
visual.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: 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 the repository
uses: actions/[email protected]
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/[email protected]
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: build:visual
workingDir: web/
exitZeroOnChanges: true