-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (55 loc) · 1.53 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
name: CI
on:
pull_request:
branches:
- '*'
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: password
ports:
- 5432/tcp
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version-file: '.tool-versions'
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Test
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:[email protected]:${{ job.services.postgres.ports[5432] }}/support_act_test
# mirror .env
SENDER: [email protected]
LAST_FM_API_KEY: testing_key
LAST_FM_API_SECRET: testing_secret
run: |
./bin/bootstrap
./bin/rake
./bin/bundle exec rubocop
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}