Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

velenyx is testing frontend code 🪲 #41

velenyx is testing frontend code 🪲

velenyx is testing frontend code 🪲 #41

Workflow file for this run

name: frontend CI
run-name: ${{ github.actor }} is testing frontend code 🪲
on:
push:
branches:
- dev-nextjs
paths:
- "client/**"
pull_request:
branches:
- dev-nextjs
paths:
- "client/**"
jobs:
pipeline:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Set up Node.JS ${{matrix.node-version}}
uses: actions/setup-node@v2
with:
node-version: ${{matrix.node-version}}
- name: Cache Yarn dependencies
uses: actions/[email protected]
with:
path: ./client/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('./client/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install yarn and dependencies
working-directory: ./client
run: |
npm install --global yarn
yarn install --frozen-lockfile
- name: Lint and Format
working-directory: ./client
run: |
yarn lint:ts:check
yarn prettier:check
- name: Build project
working-directory: ./client
run: yarn build
deploy:
needs: pipeline
if: success()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Vercel Args
id: vercel_args
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "::set-output name=args::--prod"
else
echo "::set-output name=args::"
fi
- name: Deploy Frontend
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-project-id: ${{ secrets.PROJECT_ID }}
vercel-args: ${{ steps.vercel_args.outputs.args }}
- name: Deploy Storybook
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-project-id: ${{ secrets.PROJECT_ID_STORYBOOK }}
vercel-args: ${{ steps.vercel_args.outputs.args }}