Files
twenty/.github/workflows/ci-chromatic.yaml
Jérémy M 8e319900d0 fix: github actions (#483)
fix: test unused
2023-06-30 11:35:59 +03:00

45 lines
1.3 KiB
YAML

name: 'CI Chromatic'
on:
push:
branches:
- main
pull_request_target:
jobs:
chromatic-deployment:
runs-on: ubuntu-latest
env:
REACT_APP_API_URL: http://127.0.0.1:3000/graphql
REACT_APP_AUTH_URL: http://127.0.0.1:3000/auth
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Check for redundant workflow run
run: |
HEAD_SHA=$(git rev-parse HEAD^)
if [ "$HEAD_SHA" != "${{ github.event.pull_request.head.sha }}" ]; then
echo "HEAD SHA and Pull Request HEAD SHA do not match, cancelling run"
echo "GitHub has scheduled a newer workflow run already."
exit 1
fi
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Front / Write .env
run: |
cd front
touch .env
echo "REACT_APP_API_URL: $REACT_APP_API_URL" >> .env
echo "REACT_APP_AUTH_URL: $REACT_APP_AUTH_URL" >> .env
- name: Front / Install Dependencies
run: cd front && yarn
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
workingDir: ./front
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
onlyChanged: true