Skip to content

Commit bead064

Browse files
authored
Merge pull request #32 from fey/render-test
add render config
2 parents 2f55a00 + 7e1a290 commit bead064

File tree

8 files changed

+84
-28
lines changed

8 files changed

+84
-28
lines changed

.github/workflows/docker.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Docker
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
- uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: '3.3'
25+
bundler-cache: true
26+
27+
- run: |
28+
make setup
29+
bin/rails assets:precompile
30+
make test
31+
32+
docker:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
if: ${{ github.event_name == 'push' }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- uses: docker/setup-buildx-action@v3
41+
42+
- name: Log in to GitHub Container Registry
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Build and push
50+
uses: docker/build-push-action@v6
51+
with:
52+
context: .
53+
push: true
54+
cache-from: ghcr.io/${{ github.repository }}:latest
55+
cache-to: type=inline
56+
tags: ghcr.io/${{ github.repository }}:latest

.github/workflows/main.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Main
2+
name: Render
33

44
on:
55
pull_request:
@@ -15,17 +15,19 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18+
1819
- uses: actions/setup-node@v4
1920
with:
2021
node-version: '20'
2122
cache: 'npm'
23+
2224
- uses: ruby/setup-ruby@v1
2325
with:
26+
ruby-version: '3.3'
2427
bundler-cache: true
2528

2629
- run: |
2730
make setup
28-
bin/rails assets:precompile
2931
make test
3032
3133
deploy:
@@ -36,20 +38,6 @@ jobs:
3638
steps:
3739
- uses: actions/checkout@v4
3840

39-
- uses: docker/setup-buildx-action@v3
40-
41-
- name: Log in to GitHub Container Registry
42-
uses: docker/login-action@v3
43-
with:
44-
registry: ghcr.io
45-
username: ${{ github.actor }}
46-
password: ${{ secrets.GITHUB_TOKEN }}
47-
48-
- name: Build and push
49-
uses: docker/build-push-action@v6
50-
with:
51-
context: .
52-
push: true
53-
cache-from: ghcr.io/${{ github.repository }}:latest
54-
cache-to: type=inline
55-
tags: ghcr.io/${{ github.repository }}:latest
41+
- name: Deploy
42+
run: |
43+
curl ${{ secrets.RENDER_DEPLOY_HOOK_URL }}

.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
source 'https://rubygems.org'
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
ruby '~> 3.2.2'
6+
ruby '~> 3.3.4'
77

88
gem 'bootsnap', require: false
99
gem 'cssbundling-rails'

Gemfile.lock

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ GEM
135135
matrix (0.4.2)
136136
method_source (1.0.0)
137137
mini_mime (1.1.2)
138+
mini_portile2 (2.8.8)
138139
minitest (5.19.0)
139140
minitest-power_assert (0.3.1)
140141
minitest
@@ -150,7 +151,8 @@ GEM
150151
net-smtp (0.3.3)
151152
net-protocol
152153
nio4r (2.5.9)
153-
nokogiri (1.15.3-x86_64-linux)
154+
nokogiri (1.15.3)
155+
mini_portile2 (~> 2.8.2)
154156
racc (~> 1.4)
155157
parallel (1.23.0)
156158
parser (3.2.2.3)
@@ -279,7 +281,8 @@ GEM
279281
actionpack (>= 5.2)
280282
activesupport (>= 5.2)
281283
sprockets (>= 3.0.0)
282-
sqlite3 (1.6.3-x86_64-linux)
284+
sqlite3 (1.6.3)
285+
mini_portile2 (~> 2.8.0)
283286
stimulus-rails (1.2.1)
284287
railties (>= 6.0.0)
285288
syntax_tree (6.1.1)
@@ -350,7 +353,7 @@ DEPENDENCIES
350353
webdrivers
351354

352355
RUBY VERSION
353-
ruby 3.2.1p31
356+
ruby 3.3.4p94
354357

355358
BUNDLED WITH
356359
2.4.6

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
render-build:
2+
bundle install
3+
bundle exec rails assets:precompile
4+
bundle exec rails assets:clean
5+
bundle exec rails db:migrate
6+
7+
render-start:
8+
bin/rails server
9+
110
start:
211
rm -rf tmp/pids/server.pid || true
312
bin/rails s
4-
setup: install db-prepare
13+
14+
setup: install
15+
bin/rails assets:precompile
16+
make db-prepare
517

618
install:
719
bin/setup
@@ -29,5 +41,4 @@ compose-production-run-app:
2941
compose-production-console:
3042
docker compose -p rails_bulletin_board_project_ru-production -f docker-compose.production.yml exec app bin/rails console
3143

32-
3344
.PHONY: test

config/credentials.yml.enc

Lines changed: 0 additions & 1 deletion
This file was deleted.

config/database.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ test:
2222

2323
production:
2424
<<: *default
25-
url: db/production.sqlite3
25+
url: <%= ENV['DATABASE_URL'] %>

0 commit comments

Comments
 (0)