-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (79 loc) · 2.65 KB
/
CI.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
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
push:
branches:
- main
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
FILE_PATH_VERSION_INFO: ./packages/utils-version/src/VersionInfo.ts
CACHE_PATHS_BUILD: |
./apps/ocignis-app/build-next-static
./packages/ocignis-ui/build-storybook-static
CACHE_KEY_BUILD: build-ci-${{ github.sha }}
jobs:
build:
name: Build 🏗️
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/actions/setup_node-cache_dep-install_dep
- name: Version Info 💉
run: |
COMMIT=$GITHUB_SHA
BRANCH=${GITHUB_REF#refs/heads/}
TAG=''
if [[ ${{ github.ref_type }} == 'tag' ]]; then
TAG=${GITHUB_REF#refs/tags/}
fi
echo "write tag, branch & commit id to $FILE_PATH_VERSION_INFO"
echo "export const VersionInfo = { tag: '$TAG', branch: '$BRANCH', commit: '$COMMIT' };" > $FILE_PATH_VERSION_INFO
cat $FILE_PATH_VERSION_INFO
- name: Build 🏗️
env:
NEXT_PUBLIC_NODE_ENV: 'production'
NEXT_PUBLIC_BASE_URL_OCIGNIS_API: 'https://bot-1.ocignis.com/trpc' ###
run: |
npm run build
npm run storybook-build
- name: Cache build ⚡
id: cache_build
uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS_BUILD }}
key: ${{ env.CACHE_KEY_BUILD }}
lint:
name: Lint ✅
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/actions/setup_node-cache_dep-install_dep
- name: Lint ✅
run: npm run lint
tsc:
name: TypeScript Compiler 🔎
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/actions/setup_node-cache_dep-install_dep
- name: TypeScript Compiler 🔎
run: npm run tsc
test:
name: Test 🧪
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/actions/setup_node-cache_dep-install_dep
- name: Test 🧪
run: npm run test