-
Notifications
You must be signed in to change notification settings - Fork 20
60 lines (53 loc) · 1.46 KB
/
build.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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Restore NPM cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install NPM packages
run: yarn install
- name: Run tests
run: yarn test
deploy:
name: Deploy
if: github.event_name == 'push'
needs: [test]
runs-on: ubuntu-latest
environment:
name: production
url: https://www.indexfondsenvergelijken.nl
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Restore NPM cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install NPM packages
run: yarn install
- name: Build the website
run: make dist
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 8a52e15d16e945b8f72ffec4c9c31396
projectName: indexfondsenvergelijken
directory: dist