-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (66 loc) · 1.98 KB
/
ruby.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: Ruby
on:
push:
branches: [master]
tags:
- v*
pull_request:
branches: [master]
jobs:
rspec:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:alpine
env:
POSTGRES_USER: lateral
POSTGRES_PASSWORD: lateral
POSTGRES_DB: feed-feeder_development
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:alpine
ports: ["6379:6379"]
options: --entrypoint redis-server
strategy:
matrix:
ruby-version: [2.7.2]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
run: bundle install
- name: "Rails test"
env:
RAILS_ENV: test
run: |
bundle exec rails db:setup --trace
bundle exec rspec
build:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' || github.ref_type == 'tag' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Login
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${GITHUB_ACTOR} --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker build & push Feed Feeder
run: |
docker build -t ghcr.io/lateral/feed-feeder:${GITHUB_REF_NAME} -f deployment/docker/feed-feeder/Dockerfile .
docker push ghcr.io/lateral/feed-feeder:${GITHUB_REF_NAME}
- name: Docker build & push Images
run: |
docker build -t ghcr.io/lateral/images:${GITHUB_REF_NAME} -f deployment/docker/images/Dockerfile images/
docker push ghcr.io/lateral/images:${GITHUB_REF_NAME}