-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (126 loc) Β· 4.29 KB
/
build.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Build
on:
push:
pull_request:
branches: [main]
types: [opened, synchronize, closed]
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies π
run: yarn install --immutable
- name: Run lint π
run: yarn lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies π
run: yarn install --immutable
- name: Run Test π
run: yarn test
test-storybook:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies π
run: yarn install --immutable
- name: Install Playwright π
run: yarn dlx [email protected] install
- name: Build Storybook
run: yarn build:storybook --quiet
- name: Serve Storybook and run tests π
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server dist/storybook --port 6006 --silent" \
"npx wait-on tcp:6006 && yarn test:storybook"
deploy:
needs: [test, test-storybook, lint]
if: github.event_name != 'pull_request' && contains('
refs/heads/main
refs/heads/alpha
refs/heads/beta
refs/heads/rc
', github.ref)
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies π
run: yarn install --immutable
- name: Create release π
env:
GH_TOKEN: ${{ github.token }}
run: |
export GIT_USER_EMAIL="${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
export GIT_USER_NAME="$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
git config -l
yarn dlx -p @cmflow/[email protected] cmrelease
# force rebuild
- name: Build swagger v3 (API)
run: yarn build:swagger:v3
- name: Build swagger v3 (StandAlone)
run: yarn build:swagger:standalone:v3
- name: Build feature and fix app
run: yarn build:feature-and-fix
- name: Build storybook
run: yarn build:storybook
- name: Upload artifact π
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: "./dist"
- name: Deploy to GitHub Pages π
id: deployment
uses: actions/deploy-pages@v4