-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (91 loc) · 2.41 KB
/
ci.yaml
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
name: CI Tasks
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
prepare-env:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare Environment
uses: ./.github/actions/prepare-env
lint:
name: Lint Code
runs-on: ubuntu-latest
needs: prepare-env
steps:
- uses: actions/checkout@v3
- name: Prepare Environment
uses: ./.github/actions/prepare-env
- name: eslint
run: yarn lint
lint-css:
name: Lint CSS
runs-on: ubuntu-latest
needs: prepare-env
steps:
- uses: actions/checkout@v3
- name: Prepare Environment
uses: ./.github/actions/prepare-env
- name: stylelint
run: yarn turbo run lint-css
tests:
name: Run All Tests
runs-on: ubuntu-latest
needs: prepare-env
steps:
- uses: actions/checkout@v3
- name: Prepare Environment
uses: ./.github/actions/prepare-env
- name: vitest
run: yarn test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./app/coverage/clover.xml
verbose: true
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, lint-css, tests]
steps:
- uses: actions/checkout@v3
- name: Prepare Environment
uses: ./.github/actions/prepare-env
- name: Build
run: CI=1 yarn build
- name: Export Static Assets
if: github.ref_name == 'main'
run: touch ./app/out/.nojekyll
- name: Stash Build Artifacts
if: github.ref_name == 'main'
uses: actions/upload-pages-artifact@v1
with:
path: ./app/out
deploy:
name: Deploy
if: github.ref_name == 'main'
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- name: Prepare Environment
uses: ./.github/actions/prepare-env
- name: Configure Pages
uses: actions/configure-pages@v3
with:
static_site_generator: "next"
- name: Deploy to Pages
id: deployment
uses: actions/deploy-pages@af48cf94a42f2c634308b1c9dc0151830b6f190a