-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 1.94 KB
/
pipeline.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
name: Deployment pipeline
on:
push:
branches:
- master
pull_request:
branches: [master]
types: [opened, synchronize]
jobs:
deployment_pipeline:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: npm install
run: npm run install:all
- name: lint all
run: npm run lint:all
- name: build all
run: npm run build:all
- name: test all
run: npm run test:all
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
MONGODB_TEST_URI: ${{ secrets.MONGODB_TEST_URI }}
FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }}
- name: test end-to-end with cypress
uses: cypress-io/github-action@v2
if: ${{ github.event_name == 'push' && contains(join(toJson(github.event.commits.*.message)), '#e2e')}}
env:
MONGODB_TEST_URI: ${{ secrets.MONGODB_TEST_URI }}
SECRETFORTOKEN: ${{ secrets.SECRETFORTOKEN }}
PORT: ${{ secrets.PORT }}
FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }}
ALPHAVANTAGE_API_KEY: ${{ secrets.ALPHAVANTAGE_API_KEY }}
with:
command: npm run test:e2e
start: npm run start:testserver
wait-on: http://localhost:3001
- uses: akhileshns/heroku-deploy@v3.12.12
if: ${{ github.event_name == 'push' }}
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "fso2021practicework"
heroku_email: "olli.glorioso@gmail.com"
healthcheck: "https://fso2021practicework.herokuapp.com/healthcheck"
checkstring: "Up."
rollbackonhealthcheckfailed: true
# - uses: actions/checkout@v2
# - uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# if: always()