Skip to content

Commit dbb388d

Browse files
committed
Adjust some button stylings and prepare for deployment
1 parent a1ead48 commit dbb388d

16 files changed

+124
-22
lines changed

.github/workflows/fly-deploy.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Fly Deploy
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: superfly/flyctl-actions/setup-flyctl@master
16+
- run: flyctl deploy --remote-only
17+
env:
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Dockerfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ FROM base
4242

4343
# Install packages needed for deployment
4444
RUN apt-get update -qq && \
45-
apt-get install --no-install-recommends -y curl libvips postgresql-client && \
45+
apt-get install --no-install-recommends -y \
46+
curl \
47+
libvips \
48+
postgresql-client \
49+
libjemalloc2 \
50+
libffi-dev \
51+
libyaml-dev && \
4652
rm -rf /var/lib/apt/lists /var/cache/apt/archives
4753

4854
# Copy built artifacts: gems, application

Gemfile

+2
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ group :test do
7676
end
7777

7878
gem "devise", "~> 4.9"
79+
80+
gem "dockerfile-rails", ">= 1.7", :group => :development

Gemfile.lock

+3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ GEM
113113
responders
114114
warden (~> 1.2.3)
115115
diff-lcs (1.5.1)
116+
dockerfile-rails (1.7.3)
117+
rails (>= 3.0.0)
116118
drb (2.2.1)
117119
erubi (1.12.0)
118120
factory_bot (6.4.6)
@@ -330,6 +332,7 @@ DEPENDENCIES
330332
database_cleaner-active_record
331333
debug
332334
devise (~> 4.9)
335+
dockerfile-rails (>= 1.7)
333336
factory_bot_rails
334337
guard
335338
guard-rspec

app/assets/stylesheets/global.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ body {
6060

6161
a {
6262
text-decoration: none;
63-
color: inherit;
63+
font-size: 0.8rem;
64+
color: gray;
6465
transition: color 0.2s;
6566
}
6667

app/assets/stylesheets/post.css

+7
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ article section button {
7979
color: white;
8080
}
8181

82+
article section button:nth-child(2) {
83+
background-color: #dc3545;
84+
color: white;
85+
border-radius: 4px;
86+
padding: 8px 12px;
87+
}
88+
8289
article section button:hover {
8390
background-color: #0056b3;
8491
}

app/assets/stylesheets/profile.css

+14-1
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,26 @@
3535
.delete-post-button {
3636
background-color: #dc3545;
3737
color: white;
38+
border-radius: 4px;
39+
padding: 8px 12px;
40+
}
41+
42+
.post-likes button {
43+
padding: 4px 7px;
44+
}
45+
46+
.post-comments-comments button {
47+
background-color: #dc3545;
48+
color: white;
49+
border-radius: 4px;
50+
padding: 6px 8px;
3851
}
3952

4053
.delete-post-button:hover {
4154
background-color: #c82333;
4255
}
4356

44-
/* Edit form styling */
57+
/* edit form styling */
4558
.profile-form {
4659
max-width: 600px;
4760
margin: 0 auto;

app/assets/stylesheets/users.css

+10
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@
5656
margin-top: 15px;
5757
}
5858

59+
.user-actions button {
60+
padding: 8px 12px;
61+
border-radius: 4px;
62+
transition: background-color 0.2s;
63+
}
64+
65+
.user-actions button:hover {
66+
background-color: #dedede;
67+
}
68+
5969
.user-stats {
6070
display: flex;
6171
flex-direction: column;

app/views/posts/index.html.erb

-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
3-
41
<h1>Dashboard</h1>
52

63
<div class="new-post-button">
@@ -38,8 +35,5 @@
3835
<h4>Comments:</h4>
3936
<%= render "comments", post: post %>
4037
</section>
41-
42-
<!-- Divider -->
43-
<hr class="post-divider">
4438
</article>
4539
<% end %>

app/views/posts/show.html.erb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
<%# Posts should always display the post content, author, comments, and likes. %>
31
<article class="user-post">
42
<header>
53
<h4>

app/views/profiles/_follow_button.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<%= turbo_frame_tag(dom_id(user)) do %>
32
<% if following?(user) %>
43
<%= button_to 'Unfollow', unfollow_user_profile_path(user_id: user.id), method: :delete %>

app/views/profiles/_follower_count.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<%= turbo_frame_tag "#{user.id}-follower-count" do %>
32
<div>
43
<%= pluralize(user.passive_relationships.count, "follower") %>

app/views/profiles/show.html.erb

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
<% if @user == current_user %>
42
<div class="profile-actions">
53
<%= link_to "Edit Profile", edit_user_profile_path(current_user), class: "button-link" %>
@@ -45,8 +43,10 @@
4543

4644
<div class="post-comments">
4745
<%= render "posts/comment_form", post: post, source_view: 'index' %>
48-
<h4>Comments:</h4>
49-
<%= render "posts/comments", post: post %>
46+
<div class="post-comments-comments">
47+
<h4>Comments:</h4>
48+
<%= render "posts/comments", post: post %>
49+
</div>
5050
</div>
5151
</div>
5252
<hr>

config/dockerfile.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# generated by dockerfile-rails
2+
3+
---
4+
options:
5+
label:
6+
fly_launch_runtime: rails
7+
postgresql: true
8+
prepare: false

config/environments/production.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require "active_support/core_ext/integer/time"
1+
require 'active_support/core_ext/integer/time'
22

33
Rails.application.configure do
44
# Settings specified here will take precedence over those in config/application.rb.
@@ -53,16 +53,16 @@
5353

5454
# Log to STDOUT by default
5555
config.logger = ActiveSupport::Logger.new(STDOUT)
56-
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
57-
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
56+
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
57+
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
5858

5959
# Prepend all log lines with the following tags.
60-
config.log_tags = [ :request_id ]
60+
config.log_tags = [:request_id]
6161

6262
# "info" includes generic and useful information about system operation, but avoids logging too much
6363
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
6464
# want to log everything, set the level to "debug".
65-
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
65+
config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')
6666

6767
# Use a different cache store in production.
6868
# config.cache_store = :mem_cache_store
@@ -72,6 +72,8 @@
7272
# config.active_job.queue_name_prefix = "odinbook_production"
7373

7474
config.action_mailer.perform_caching = false
75+
config.action_mailer.perform_deliveries = false
76+
config.action_mailer.delivery_method = :test
7577

7678
# Ignore bad email addresses and do not raise email delivery errors.
7779
# Set this to true and configure the email server for immediate delivery to raise delivery errors.

fly.toml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# fly.toml app configuration file generated for frendo on 2025-01-31T08:47:28-05:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'frendo'
7+
primary_region = 'ewr'
8+
console_command = '/rails/bin/rails console'
9+
10+
[build]
11+
12+
[deploy]
13+
release_command = './bin/rails db:prepare'
14+
15+
[http_service]
16+
internal_port = 3000
17+
force_https = true
18+
auto_stop_machines = 'stop'
19+
auto_start_machines = true
20+
min_machines_running = 0
21+
processes = ['app']
22+
23+
[[http_service.checks]]
24+
interval = '10s'
25+
timeout = '2s'
26+
grace_period = '5s'
27+
method = 'GET'
28+
path = '/up'
29+
protocol = 'http'
30+
tls_skip_verify = false
31+
32+
[http_service.checks.headers]
33+
X-Forwarded-Proto = 'https'
34+
35+
[[vm]]
36+
memory = '1gb'
37+
cpu_kind = 'shared'
38+
cpus = 1
39+
40+
[[statics]]
41+
guest_path = '/rails/public'
42+
url_prefix = '/'

0 commit comments

Comments
 (0)