This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
velenyx is testing frontend code 🪲 #29
Workflow file for this run
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: 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@v2 | |
- name: Starting 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 | |
run: npm install --global yarn | |
- name: Install dependencies | |
working-directory: ./client | |
run: yarn install --frozen-lockfile | |
- name: Run Linting | |
working-directory: ./client | |
run: yarn lint:ts:check | |
- name: Run Prettier formatter | |
working-directory: ./client | |
run: yarn prettier:check | |
- name: Build project | |
working-directory: ./client | |
run: yarn build | |
deploy: | |
needs: pipeline | |
if: success() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Check if deployed | |
id: cache-check | |
uses: actions/[email protected] | |
with: | |
path: ./DEPLOYED | |
key: deployed-frontend | |
- name: Deploy to Vercel | |
if: steps.cache-check.outputs.cache-hit != 'true' | |
uses: amondnet/vercel-action@v25 | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Mark as deployed | |
if: steps.cache-check.outputs.cache-hit != 'true' | |
run: touch ./DEPLOYED |