2023-06-01 12:20:05 +03:00
|
|
|
name: 'CI Chromatic'
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-06-27 18:55:07 +03:00
|
|
|
branches:
|
|
|
|
- main
|
2023-09-17 02:33:23 +03:00
|
|
|
pull_request:
|
2023-08-01 04:23:39 +03:00
|
|
|
types: [labeled]
|
2023-06-01 12:20:05 +03:00
|
|
|
jobs:
|
|
|
|
chromatic-deployment:
|
2023-09-17 08:29:16 +03:00
|
|
|
if: contains(github.event.pull_request.labels.*.name, 'run-chromatic') || github.event_name == 'push'
|
2023-06-01 12:20:05 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-08-01 00:36:04 +03:00
|
|
|
REACT_APP_SERVER_BASE_URL: http://127.0.0.1:3000
|
2023-06-01 12:20:05 +03:00
|
|
|
steps:
|
2023-09-17 02:33:23 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-17 05:28:04 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-06-01 12:20:05 +03:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: "18"
|
|
|
|
- name: Front / Write .env
|
|
|
|
run: |
|
|
|
|
cd front
|
|
|
|
touch .env
|
2023-08-01 00:36:04 +03:00
|
|
|
echo "REACT_APP_SERVER_BASE_URL: $REACT_APP_SERVER_BASE_URL" >> .env
|
2023-06-01 12:20:05 +03:00
|
|
|
- name: Front / Install Dependencies
|
2023-06-14 17:56:29 +03:00
|
|
|
run: cd front && yarn
|
2023-06-01 12:20:05 +03:00
|
|
|
- name: Publish to Chromatic
|
|
|
|
uses: chromaui/action@v1
|
|
|
|
with:
|
|
|
|
workingDir: ./front
|
|
|
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
2023-06-13 19:45:18 +03:00
|
|
|
onlyChanged: true
|
2023-07-07 04:53:26 +03:00
|
|
|
buildScriptName: storybook:build
|
2023-06-01 12:20:05 +03:00
|
|
|
|