.github/workflows/reg.yml

Summary

Maintainability
Test Coverage
name: Regsuit

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Use Node.js v14
        uses: actions/setup-node@v2
        with:
          node-version: '14.x'
      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - uses: actions/cache@v2
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-
      - name: Install modules
        run: yarn
      - run: yarn storybook:build
      - run: yarn screenshot
      - name: workaround for detached HEAD
        run: git checkout ${GITHUB_REF#refs/heads/} || git checkout -b ${GITHUB_REF#refs/heads/} && git pull
      - name: prepare gcp key
        id: prepare_gcp_key
        run: GOOGLE_APPLICATION_CREDENTIALS=$(mktemp) && echo $GOOGLE_APPLICATION_CREDENTIALS_BASE64 | base64 -d > $GOOGLE_APPLICATION_CREDENTIALS && echo "::set-output name=GOOGLE_APPLICATION_CREDENTIALS::$GOOGLE_APPLICATION_CREDENTIALS"
        env:
          GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS_BASE64}}
      - name: run reg-suit
        run: yarn reg-suit run
        env:
          GOOGLE_APPLICATION_CREDENTIALS: ${{steps.prepare_gcp_key.outputs.GOOGLE_APPLICATION_CREDENTIALS}}