-
Notifications
You must be signed in to change notification settings - Fork 50
76 lines (65 loc) · 2.17 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
name: SpreadSheet To Site
on:
schedule:
- cron: '0 1 * * *'
push:
branches:
- master
paths-ignore:
- README.md
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
- name: Checkout 🛎
uses: actions/checkout@master
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Setup node env 🏗
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache directory path 🛠
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node_modules 📦
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies 👨🏻💻
run: yarn
- name: Get data from spreadsheet 👨🏻💻
env: # Or as an environment variable
GH_API_KEY: ${{ secrets.GH_API_KEY }}
API_KEY: ${{ secrets.API_KEY }}
SPREADSHEET_ID: ${{ secrets.SPREADSHEET_ID }}
run: yarn data
- name: Run prettier
run: yarn prettier
- name: Run unit tests
run: yarn test
- name: Create local changes & push to GitHub
run: |
yarn build
yarn deploy:time
# yarn generate
# echo 'findmentor.network' > ./docs/CNAME
git add .
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Add changes"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
force: true