-
Notifications
You must be signed in to change notification settings - Fork 36
116 lines (116 loc) · 4.03 KB
/
deploy.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
name: Build and Deploy Cozy-ui
on:
push:
branches: [ master ]
pull_request:
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_modules
prepareArgos:
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_argos
build:
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/setup_modules
- uses: ./.github/actions/build_cache
- name: Lint
run: yarn lint
- name: Generate Sprite and Palette
run: yarn makeSpriteAndPalette
- name: Build JS
run: yarn build
- name: Build CSS
run: yarn build:css:all
- name: Build docs
run: |
yarn build:doc:react
yarn build:doc:kss
test:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_modules
- uses: ./.github/actions/build_cache_read
- name: BundleMon
uses: lironer/bundlemon-action@v1
- name: Tests
run: yarn test
argosDesktop:
needs: [prepareArgos, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_argos
- uses: ./.github/actions/build_cache_read
- uses: ./.github/actions/build_argos_desktop_cache
- name: Argos - Create desktop screenshots
run: |
mkdir -p ./screenshots
yarn screenshots --mode react --viewport desktop --screenshot-dir ./screenshots/reactDesktop
argosMobile:
needs: [prepareArgos, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_argos
- uses: ./.github/actions/build_cache_read
- uses: ./.github/actions/build_argos_mobile_cache
- name: Argos - Create mobile screenshots
run: |
mkdir -p ./screenshots
yarn screenshots --mode react --viewport 300x600 --screenshot-dir ./screenshots/reactMobile
argosKss:
needs: [prepareArgos, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_argos
- uses: ./.github/actions/build_cache_read
- uses: ./.github/actions/build_argos_kss_cache
- name: Argos - Create kss screenshots
run: |
mkdir -p ./screenshots
yarn screenshots --mode kss --screenshot-dir ./screenshots/kss
argosUpload:
needs: [argosDesktop, argosMobile, argosKss]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_argos
- uses: ./.github/actions/build_argos_desktop_cache
- uses: ./.github/actions/build_argos_mobile_cache
- uses: ./.github/actions/build_argos_kss_cache
- name: Argos - Upload all screenshots
run: |
UUID=$(uuidgen)
yarn argos:upload --parallel screenshots/reactDesktop/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_RUN_ID-${UUID} --ignore ''
yarn argos:upload --parallel screenshots/reactMobile/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_RUN_ID-${UUID} --ignore ''
yarn argos:upload --parallel screenshots/kss/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_RUN_ID-${UUID} --ignore ''
deploy:
needs: [argosUpload, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/setup_modules
- uses: ./.github/actions/build_cache_read
- name: Deploy
if: ${{ github.ref_name == 'master' }}
run: yarn deploy:doc --username cozycloud --email [email protected] --repo https://cozy-bot:[email protected]/cozy/cozy-ui.git && yarn semantic-release