-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 2.18 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
name: CI
on: [push]
jobs:
frontend:
runs-on: ubuntu-18.04
steps:
- name: Checkout this repo
uses: actions/checkout@v1
- name: Install nodejs
uses: actions/[email protected]
with:
node-version: 13.6.0
- name: Lint
run: exit 0 && cd frontend && npm ci && npm run lint
- name: Build
run: cd frontend && npm i && npm run build
- name: Test
run: exit 0 && cd frontend && npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
- name: Send notification
uses: yanzay/[email protected]
if: always()
with:
chat: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
status: ${{ job.status }}
backend:
runs-on: ubuntu-18.04
steps:
- name: Checkout this repo
uses: actions/checkout@v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path backend/Cargo.toml
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path backend/Cargo.toml
- name: Send notification # FIXME: find a way to extract this into a job (deduplicate notifications)
uses: yanzay/[email protected]
if: always()
with:
chat: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
status: ${{ job.status }}
deploy:
runs-on: ubuntu-18.04
needs: [frontend, backend]
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout this repo
uses: actions/checkout@v1
- name: deploy to Heroku
env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
HEROKU_APP_NAME: ${{ secrets.HEROKU_APP_NAME }}
run: git push -f https://heroku:[email protected]/$HEROKU_APP_NAME.git refs/remotes/origin/master:refs/heads/master