fix conflicts #1
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
name: 'deploy to chromatic' | |
on: | |
push: | |
paths: | |
- 'js/**' | |
- 'gradio/themes/**' | |
- '.github/workflows/deploy-chromatic.yml' | |
- '!js/_website/**' | |
jobs: | |
get-current-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: 8BitJonny/gh-get-current-pr@2.2.0 | |
id: get-pr | |
outputs: | |
pr_found: ${{ steps.get-pr.outputs.pr_found }} | |
pr_number: ${{ steps.get-pr.outputs.number }} | |
pr_labels: ${{ steps.get-pr.outputs.pr_labels }} | |
chromatic-deployment: | |
needs: get-current-pr | |
runs-on: ubuntu-latest | |
if: ${{ github.repository == 'gradio-app/gradio' && !contains(needs.get-current-pr.outputs.pr_labels, 'no-visual-update') }} | |
steps: | |
- name: post pending deployment comment to PR | |
if: ${{ needs.get-current-pr.outputs.pr_found }} == 'true' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
Chromatic build pending :hourglass: | |
comment_tag: chromatic-build | |
GITHUB_TOKEN: ${{ secrets.COMMENT_TOKEN }} | |
pr_number: ${{ needs.get-current-pr.outputs.pr_number }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: install dependencies | |
uses: "./.github/actions/install-all-deps" | |
with: | |
always-install-pnpm: true | |
skip_build: 'true' | |
- name: generate theme.css | |
run: | | |
. venv/bin/activate | |
python scripts/generate_theme.py --outfile js/storybook/theme.css | |
- name: build storybook | |
run: pnpm build-storybook --quiet | |
- name: publish to chromatic | |
id: publish-chromatic | |
uses: chromaui/action@v1 | |
with: | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: post deployment link to PR | |
if: ${{ needs.get-current-pr.outputs.pr_found }} == 'true' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
:tada: Chromatic build completed! | |
There are ${{ steps.publish-chromatic.outputs.changeCount }} visual changes to review. | |
There are ${{ steps.publish-chromatic.outputs.errorCount }} failed tests to fix. | |
* [Storybook Preview](${{ steps.publish-chromatic.outputs.storybookUrl }}) | |
* [Build Review](${{ steps.publish-chromatic.outputs.buildUrl }}) | |
GITHUB_TOKEN: ${{ secrets.COMMENT_TOKEN }} | |
comment_tag: chromatic-build | |
pr_number: ${{ needs.get-current-pr.outputs.pr_number }} |