This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
exortme1ster is starting sueta at the frontend code ☺️ #72
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 checker, will punish for bad code 🪓😵💫 | |
run-name: ${{ github.actor }} is starting sueta at the frontend code ☺️ | |
on: | |
push: | |
branches: | |
- dev-nextjs | |
paths: | |
- "client/**" | |
pull_request: | |
branches: | |
- dev-nextjs | |
paths: | |
- "client/**" | |
jobs: | |
pipeline: | |
# Exclude renovate[bot] from triggering the workflow | |
if: github.actor != 'renovate[bot]' | |
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@v3 | |
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 }} |