-
Notifications
You must be signed in to change notification settings - Fork 1.8k
106 lines (98 loc) · 2.78 KB
/
ci.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
name: CI
on:
push:
branches: [ development, master, testing ]
pull_request:
branches: [ development, master, testing ]
jobs:
install:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn
- name: Setup Node.js
uses: actions/setup-node@v1
if: steps.cache.outputs.cache-hit != 'true'
with:
node-version: 14.x
- run: yarn
if: steps.cache.outputs.cache-hit != 'true'
lint:
name: Lint
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# no restore-keys here, so we only accept this exact version
- run: yarn lint
test:
name: Test
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Copy .env
run: cp '.env.example' '.env'
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# no restore-keys here, so we only accept this exact version
- run: yarn l10n:generate
- run: COVERAGE=true yarn test
- name: Code Coverage
uses: codecov/codecov-action@v1
build:
name: Build
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# no restore-keys here, so we only accept this exact version
- run: yarn l10n:extract
- run: yarn l10n:update
- run: yarn l10n:generate
- run: ROOT_URL=open-event-frontend yarn build -prod
env:
API_HOST: https://open-event.dokku.fossasia.org
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/development' && github.event_name == 'push'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
force_orphan: true