-
Notifications
You must be signed in to change notification settings - Fork 106
63 lines (49 loc) · 1.88 KB
/
main.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
name: Test, Lint, Build and Deploy on Github Pages
on:
push:
branches: ["master", "main"]
# Позволяет запустить этот рабочий процесс вручную на вкладке Actions
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# Устанавливаем зависимости
- name: Install dependencies
run: npm install
# Запускаем тесты и линтер
- name: Run tests and linter
run: npm run lint && npm test
# Собираем приложение
# - name: Build Application
# run: npm run build
# Публикуем приложение на Github Pages
# - name: Deploy to Github Pages
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: dist
# # Собираем Storybook
- name: Build Storybook
run: npm run build-storybook
# # Публикуем Storybook на Github Pages
- name: Deploy Storybook to Github Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: storybook-static
commit-message: "Automatically publish Storybook"
# Останавливаем выполнение строго при неудачных тестах
- name: Fail on failed tests
run: |
if [ ${{ job.status }} == 'failure' ]; then exit 1; fi;