Skip to content

Commit

Permalink
Merge pull request #32 from fey/render-test
Browse files Browse the repository at this point in the history
add render config
  • Loading branch information
fey authored Feb 11, 2025
2 parents 2f55a00 + 7e1a290 commit bead064
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 28 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Docker

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- run: |
make setup
bin/rails assets:precompile
make test
docker:
needs: build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}

steps:
- uses: actions/checkout@v4

- uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
cache-from: ghcr.io/${{ github.repository }}:latest
cache-to: type=inline
tags: ghcr.io/${{ github.repository }}:latest
26 changes: 7 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Main
name: Render

on:
pull_request:
Expand All @@ -15,17 +15,19 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- run: |
make setup
bin/rails assets:precompile
make test
deploy:
Expand All @@ -36,20 +38,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
cache-from: ghcr.io/${{ github.repository }}:latest
cache-to: type=inline
tags: ghcr.io/${{ github.repository }}:latest
- name: Deploy
run: |
curl ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '~> 3.2.2'
ruby '~> 3.3.4'

gem 'bootsnap', require: false
gem 'cssbundling-rails'
Expand Down
9 changes: 6 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ GEM
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.8.8)
minitest (5.19.0)
minitest-power_assert (0.3.1)
minitest
Expand All @@ -150,7 +151,8 @@ GEM
net-smtp (0.3.3)
net-protocol
nio4r (2.5.9)
nokogiri (1.15.3-x86_64-linux)
nokogiri (1.15.3)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.3)
Expand Down Expand Up @@ -279,7 +281,8 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.6.3-x86_64-linux)
sqlite3 (1.6.3)
mini_portile2 (~> 2.8.0)
stimulus-rails (1.2.1)
railties (>= 6.0.0)
syntax_tree (6.1.1)
Expand Down Expand Up @@ -350,7 +353,7 @@ DEPENDENCIES
webdrivers

RUBY VERSION
ruby 3.2.1p31
ruby 3.3.4p94

BUNDLED WITH
2.4.6
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
render-build:
bundle install
bundle exec rails assets:precompile
bundle exec rails assets:clean
bundle exec rails db:migrate

render-start:
bin/rails server

start:
rm -rf tmp/pids/server.pid || true
bin/rails s
setup: install db-prepare

setup: install
bin/rails assets:precompile
make db-prepare

install:
bin/setup
Expand Down Expand Up @@ -29,5 +41,4 @@ compose-production-run-app:
compose-production-console:
docker compose -p rails_bulletin_board_project_ru-production -f docker-compose.production.yml exec app bin/rails console


.PHONY: test
1 change: 0 additions & 1 deletion config/credentials.yml.enc

This file was deleted.

2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ test:

production:
<<: *default
url: db/production.sqlite3
url: <%= ENV['DATABASE_URL'] %>

0 comments on commit bead064

Please sign in to comment.