Skip to content

Commit

Permalink
Merge pull request #670 from bitzesty/staging
Browse files Browse the repository at this point in the history
Production release
  • Loading branch information
dreamfall authored Feb 28, 2024
2 parents ef7f22d + 561151c commit 1f5ea9d
Show file tree
Hide file tree
Showing 213 changed files with 17,314 additions and 9,279 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
ruby-version: 3.2.2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
node-version: '16'
- run: npm install -g yarn
- uses: nanasess/setup-chromedriver@master
- name: Build and run tests
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/slack_notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check for tests or deployment results
on:
workflow_run:
workflows: ["CI"]
types: [completed]

jobs:
notify-slack:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- name: Extract Slack ID for author
id: extract_slack_id
run: |
#!/bin/bash
# user_string="johndoe:U12345678, janedoe:U87654321, alice:U98765432"
user_string="${{ vars.SLACK_USER_IDS }}"
suid=""
IFS=", " read -r -a users <<< "$user_string"
for user in "${users[@]}"; do
IFS=':' read -r github_username slack_user_id <<< "$user"
if [ "$github_username" == "${{github.actor}}" ]; then
suid="$slack_user_id"
break
fi
done
echo "::set-output name=suid::$suid"
- name: tests
uses: ravsamhq/notify-slack-action@v2
if: ${{ github.event.workflow_run.head_branch != 'main' && github.event.workflow_run.head_branch != 'staging' && github.event.workflow_run.head_branch != 'production' }}
with:
status: ${{ github.event.workflow_run.conclusion }}
notification_title: "Tests ${{github.event.workflow_run.conclusion}} on *${{github.event.workflow_run.head_branch}}* - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>"
message_format: "{emoji} *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <{repo_url}|{repo}>"
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>"
mention_users: ${{ steps.extract_slack_id.outputs.suid }}
mention_users_when: "failure,warnings"
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.7
3.2.2
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
ARG RUBY_VERSION=2.7.7
ARG RUBY_VERSION=3.2.2

FROM ruby:2.7.7
FROM ruby:${RUBY_VERSION}

ENV HOME=/app
WORKDIR /app

# ENV SSL_CERT_DIR=/etc/ssl/certs
# ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

# Install NodeJS
RUN apt-get update
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y nodejs npm
RUN npm install yarn -g

# ENV SSL_CERT_DIR=/etc/ssl/certs
# ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

ENV CURL_CONNECT_TIMEOUT=0 CURL_TIMEOUT=0 GEM_PATH="$HOME/vendor/bundle/ruby/${RUBY_VERSION}:$GEM_PATH" LANG=${LANG:-en_US.UTF-8} PATH="$HOME/bin:$HOME/vendor/bundle/bin:$HOME/vendor/bundle/ruby/${RUBY_VERSION}/bin:$PATH" RACK_ENV=${RACK_ENV:-production} RAILS_ENV=${RAILS_ENV:-production} RAILS_SERVE_STATIC_FILES=${RAILS_SERVE_STATIC_FILES:-enabled} SECRET_KEY_BASE=${SECRET_KEY_BASE:-PLACEHOLDERSECRETBASEKEY}

# Cache bundler
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock

RUN bundle config set --local path 'vendor/bundle'
RUN bundle config set --local without 'development test'
RUN bundle install --jobs 4 --retry 3

COPY . /app


RUN yarn install
RUN RAILS_ENV=production NODE_ENV=production DATABASE_URL=postgresql://localhost/dummy_url bundle exec rake assets:precompile
30 changes: 15 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ source 'https://rubygems.org'

git_source(:github) { |name| "https://github.com/#{name}.git" }

ruby '~> 2.7.7'
ruby '~> 3.2.2'

gem 'rails', '6.1.7.1'
gem 'rails', '7.1.1'
gem 'websocket-extensions', '~> 0.1.5'

# SSL redirect
Expand All @@ -15,22 +15,22 @@ gem 'pg'
gem 'activerecord-import'

# Track Changes
gem 'paper_trail', '~> 10.3'
gem 'paper_trail', '~> 15.0'

# Assets & Templates
gem 'sprockets', '~> 3.7.2'
gem 'sprockets-rails', '>= 2.0.0'
gem 'slim-rails', '~> 3.2.0'
gem 'coffee-rails', '5.0'
gem 'jquery-rails', '4.4.0'
gem 'jquery-rails', '~> 4.4'
gem 'jquery-ui-rails', '6.0.1'
gem 'bootstrap-sass', '~> 3.4'
gem 'govuk_frontend_toolkit', '~> 3.1.0'
gem 'govuk_template', '0.12.0'
gem 'uglifier', '>= 2.7.2'
gem "terser", "~> 1.1"
gem 'js_cookie_rails', '2.1.4'
gem 'ckeditor'
gem 'webpacker', '6.0.0.beta.7'
gem 'webpacker'

# Autolinking in admin mass user mailer
gem 'rails_autolink'
Expand Down Expand Up @@ -70,7 +70,7 @@ gem 'kaminari'
gem 'wicked', '~> 1.1'

# Statemachine
gem 'statesman', '3.5.0'
gem 'statesman', '~> 11.0'

# Form & Data helpers
gem 'simple_form', '~> 5.0'
Expand All @@ -84,7 +84,7 @@ gem 'prawn-table'
gem 'nokogiri'

# Uploads
gem 'carrierwave', '~> 2.2.2'
gem 'carrierwave', '~> 2.2.5'
gem 'google-cloud-storage', '~> 1.34.1'
gem 'carrierwave-google-storage', github: "bitzesty/carrierwave-google-storage", ref: 'c706a21c6c25045cae2e39bcab5bf594af0bcf46'
gem 'vigilion', '~> 1.0.4', github: 'vigilion/vigilion-ruby', ref: '7d6a7e5'
Expand Down Expand Up @@ -124,7 +124,7 @@ gem 'nilify_blanks'
gem 'curb', '0.9.10'

# Web server
gem 'puma', '~> 5.6.7'
gem 'puma', '~> 5.6.8'

# Performance & Error reporting
gem 'appsignal'
Expand All @@ -150,15 +150,15 @@ gem 'rack-canonical-host'

gem 'rails-healthcheck'

gem 'matrix', '~> 0.4.1'

group :development do
gem 'letter_opener'
gem 'rack-mini-profiler', '>= 0.10.1', require: false
gem 'binding_of_caller'
gem 'rubocop', '~> 0.52', require: false
# When need to copy model with nested associations
gem 'amoeba', '3.0.0'
# for RailsPanel Chrome extension
gem 'meta_request'
gem 'listen'

# Fixes https://github.com/rails/rails/issues/26658#issuecomment-255590071
Expand All @@ -169,20 +169,20 @@ gem 'dotenv-rails'

group :development, :test do
# Enviroment variables
gem 'rspec-rails', '~> 4.0.1'
gem 'rspec-rails', '~> 6.0'
gem 'rspec-github', require: false
gem "pry-byebug"
gem 'rails-controller-testing'
gem "selenium-webdriver"
end

group :test do
gem 'factory_bot_rails'
gem 'capybara', '3.33'
gem 'factory_bot_rails', '6.2' # https://github.com/thoughtbot/factory_bot_rails/issues/433
gem 'capybara', '~> 3.39'
gem 'poltergeist'
gem 'database_cleaner-active_record'
gem 'launchy'
gem 'turnip', '~> 4.2.0'
gem 'turnip', '~> 4.4.0'
gem 'shoulda-matchers', require: false
gem 'pdf-inspector', require: 'pdf/inspector'
gem 'codeclimate_circle_ci_coverage'
Expand Down
Loading

0 comments on commit 1f5ea9d

Please sign in to comment.