Merge pull request #83 from danskernesdigitalebibliotek/DDFBRA-291-in… #281
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow name | |
name: "Chromatic" | |
# Event for the workflow | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "**.css" | |
- "**.js" | |
- "**.tsx" | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
paths: | |
- "**.css" | |
- "**.js" | |
- "**.tsx" | |
# List of jobs | |
jobs: | |
chromatic-deployment: | |
name: Chromatic | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# Make sure the actual branch is checked out when running on pull requests. | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 # 👈 Required to retrieve git history | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Install dependencies | |
run: npm install --legacy-peer-deps | |
- name: Publish to Chromatic | |
uses: chromaui/action@v1 | |
# Chromatic GitHub Action options | |
with: | |
# 👇 Chromatic projectToken, refer to the manage page to obtain it. | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} |