This repository was archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (80 loc) · 2.09 KB
/
ci.yml
File metadata and controls
83 lines (80 loc) · 2.09 KB
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
name: CI
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2.1.5
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Check linting
uses: actions/setup-node@v2.1.5
with:
node-version: 14
- run: yarn
if: steps.cache.outputs.cache-hit != 'true'
- run: yarn lint
test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- uses: actions/cache@v2.1.5
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Coverage
uses: actions/setup-node@v2.1.5
with:
node-version: 14
- run: yarn
if: steps.cache.outputs.cache-hit != 'true'
- run: yarn run test:coverage
build:
runs-on: ubuntu-18.04
needs: [lint, test]
steps:
- uses: actions/checkout@v2
- name: Build
uses: actions/setup-node@v2.1.5
with:
node-version: 14
- run: yarn --pure-lockfile
- run: yarn run build
deploy:
runs-on: ubuntu-18.04
needs: [build]
if: github.ref == 'refs/heads/main'
env:
GIT_COMMITTER_NAME: Coco Bot
GIT_COMMITTER_EMAIL: contact@coco-erp.fr
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow --tags
- name: Deploy NPM And Storybook
uses: actions/setup-node@v2.1.5
with:
node-version: 14
- run: yarn --pure-lockfile
- run: yarn run build
- run: yarn run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn run build-storybook
- run: git fetch
- run: git config user.name $GIT_COMMITTER_NAME
- run: git config user.email $GIT_COMMITTER_EMAIL
- run: git add .
- run: git commit -m "Deploy storybook"
- run: git push -f --quiet origin main:gh-pages