-
Notifications
You must be signed in to change notification settings - Fork 6
72 lines (72 loc) · 1.85 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
71
72
name: CI
on:
push:
branches-ignore: [main]
permissions:
packages: write
jobs:
standard:
name: Standard
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run Standard
run: bundle exec standardrb
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 15
services:
postgres:
image: postgres:15.3
ports: ["5432:5432"]
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: hackathons_test
redis:
image: redis:7.0
ports: ["6379:6379"]
steps:
- name: Install system dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update -yqq
sudo apt-get install -yqq libvips
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run tests
run: bin/rails test; bin/rails test:system
env:
RAILS_ENV: test
DATABASE_URL: postgresql://[email protected]:5432
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Docker
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}