This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (78 loc) · 2.4 KB
/
client.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Frontend checker, will punish for bad code 🪓😵💫
run-name: ${{ github.actor }} is starting sueta at the frontend code ☺️
on:
push:
branches:
- develop
- master
paths:
- "client/**"
pull_request:
branches:
- develop
- master
paths:
- "client/**"
jobs:
pipeline:
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}}
cache: 'yarn'
cache-dependency-path: ./client/yarn.lock
- name: Install yarn and dependencies
working-directory: ./client
run: |
npm install --global yarn
yarn install --immutable
- name: Lint and Format
working-directory: ./client
run: |
yarn lint:ts:check
yarn prettier:check
- name: Unit testing 💀💀
working-directory: ./client
run: yarn test:unit
- 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 }}