-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (58 loc) · 2.13 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
name: ci
# Run Rails tests & Jest. If pass & on master, deploy to Heroku.
on: push
jobs:
ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.5
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0 # heroku needs an unshallow clone
- name: Install PostgreSQL 11 client
run: sudo apt-get -yqq install libpq-dev
- name: Increase the amount of inotify watchers
# started getting this error around 20-03-01
# https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
- name: rails db:setup test test:system
env:
PGHOST: localhost
PGUSER: postgres
RAILS_ENV: test
RUBYOPT: "-W:no-deprecated -W:no-experimental"
run: |
bin/rails db:setup
bin/rails test
bin/rails test:system
- name: jest
run: npx jest test/javascript
- name: heroku deploy motzi
if: github.ref == 'refs/heads/master' && job.status == 'success'
uses: akhileshns/[email protected] # This is the action
with:
heroku_app_name: motzibread
heroku_email: ${{secrets.HEROKU_EMAIL}}
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
- name: heroku deploy jinji
if: github.ref == 'refs/heads/master' && job.status == 'success'
uses: akhileshns/[email protected] # This is the action
with:
heroku_app_name: jinjichocolate
heroku_email: ${{secrets.HEROKU_EMAIL}}
heroku_api_key: ${{secrets.HEROKU_API_KEY}}