Skip to content

Commit

Permalink
Merge pull request #45 from puzzle/github_build_workflow
Browse files Browse the repository at this point in the history
GitHub build & Rails upgrade
  • Loading branch information
Robin481 authored Dec 22, 2023
2 parents dbfc5b2 + 5a79848 commit d4be28f
Show file tree
Hide file tree
Showing 9 changed files with 231 additions and 159 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: build

on:
push:
branches:
- 'github_build_workflow'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Puzzle Registry
uses: docker/login-action@v3
with:
registry: registry.puzzle.ch
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: registry.puzzle.ch/ruby_ops/statuscope:latest
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.5.5
ruby-3.2.2
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# Build Stage #
#################################

FROM ruby:3.0 AS build
FROM ruby:3.2 AS build

# Set build shell
SHELL ["/bin/bash", "-c"]

# Use root user
USER root

ARG BUNDLER_VERSION=2.3.23
ARG BUNDLER_VERSION=2.5.1

ARG PRE_INSTALL_SCRIPT
ARG BUILD_PACKAGES="sqlite3 libsqlite3-dev build-essential"
Expand Down Expand Up @@ -65,7 +65,7 @@ RUN rm -rf vendor/cache/ .git spec/ node_modules/ tmp/ \
#################################

# This image will be replaced by Openshift
FROM ruby:3.0-slim AS app
FROM ruby:3.2-slim AS app

# Set runtime shell
SHELL ["/bin/bash", "-c"]
Expand All @@ -74,7 +74,7 @@ SHELL ["/bin/bash", "-c"]
RUN adduser --disabled-password --uid 1001 --gid 0 --gecos "" app

ARG BUNDLE_WITHOUT='development:metrics:test'
ARG RUN_PACKAGES
ARG RUN_PACKAGES='sqlite3'

ENV RAILS_ENV=production \
RAILS_DB_ADAPTER=sqlite3
Expand Down Expand Up @@ -103,4 +103,4 @@ RUN bundle config set --local deployment 'true' \

USER 1001

CMD ["bundle", "exec", "puma", "-t", "8"]
CMD ["bundle", "exec", "puma", "-t", "8", "-p", "8080"]
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ gem 'rails'

gem 'sqlite3' # database

gem 'puma', '~> 4.3' # app server
gem 'puma' # app server

# gem 'jbuilder', '~> 2.5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

gem 'bootsnap', '>= 1.1.0', require: false # Reduces boot times through caching
gem 'bootsnap', require: false # Reduces boot times through caching

group :development, :test do
gem 'pry-byebug' # integrate proper debugging
Expand All @@ -23,5 +23,5 @@ group :development, :test do
end

group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'listen'
end
Loading

0 comments on commit d4be28f

Please sign in to comment.