Merge pull request #771 from WPMedia/THEMES-1440-hotfix #803
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 storybook | |
# Event for the workflow | |
on: | |
push: | |
branches-ignore: | |
- "dependabot/**" | |
jobs: | |
chromatic_publish_validate: | |
runs-on: ubuntu-latest | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.THEMES_OPS_SLACK_WEBHOOK_URL }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # 👈 Required to retrieve git history | |
- name: Setup Node with 12 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "12" | |
registry-url: "https://npm.pkg.github.com" | |
- name: Cache Node Modules | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
- name: Clean install (CI) dependencies if lockfile (above) changed | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish storybook | |
uses: chromaui/action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
- name: Check failure status and post in themes ops channel | |
uses: act10ns/slack@v1 | |
with: | |
status: ${{ job.status }} | |
if: failure() |