Skip to content

Commit

Permalink
fly-io
Browse files Browse the repository at this point in the history
  • Loading branch information
baskint committed Jul 2, 2024
1 parent 4736ffd commit 9395ad0
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Fly Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ gem "bootsnap", require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

# fix until ruby 3.3.4 is release
gem 'net-pop', github: 'ruby/net-pop'

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri windows ]
Expand All @@ -68,3 +71,5 @@ group :test do
gem "capybara"
gem "selenium-webdriver"
end

gem "dockerfile-rails", ">= 1.6", :group => :development
13 changes: 11 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
GIT
remote: https://github.com/ruby/net-pop.git
revision: e8d0afe2773b9eb6a23c39e9e437f6fc0fc7c733
specs:
net-pop (0.1.2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -99,6 +105,8 @@ GEM
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
dockerfile-rails (1.6.17)
rails (>= 3.0.0)
drb (2.2.1)
erubi (1.13.0)
globalid (1.2.1)
Expand Down Expand Up @@ -134,7 +142,6 @@ GEM
net-imap (0.4.14)
date
net-protocol
net-pop (0.1.2)
net-protocol (0.2.2)
timeout
net-smtp (0.5.0)
Expand Down Expand Up @@ -259,7 +266,7 @@ GEM
PLATFORMS
aarch64-linux
arm-linux
arm64-darwin
arm64-darwin-23
x86-linux
x86_64-darwin
x86_64-linux
Expand All @@ -268,8 +275,10 @@ DEPENDENCIES
bootsnap
capybara
debug
dockerfile-rails (>= 1.6)
importmap-rails
jbuilder
net-pop!
pg (~> 1.1)
puma (>= 5.0)
rails (~> 7.1.3, >= 7.1.3.4)
Expand Down
8 changes: 8 additions & 0 deletions config/dockerfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# generated by dockerfile-rails

---
options:
label:
fly_launch_runtime: rails
postgresql: true
prepare: false
45 changes: 45 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# fly.toml app configuration file generated for board-sports-ror on 2024-07-02T13:26:03-05:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'board-sports-ror'
primary_region = 'ord'
console_command = '/rails/bin/rails console'

[build]

[deploy]
release_command = './bin/rails db:prepare'

[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[checks]
[checks.status]
port = 3000
type = 'http'
interval = '10s'
timeout = '2s'
grace_period = '5s'
method = 'GET'
path = '/up'
protocol = 'http'
tls_skip_verify = false

[checks.status.headers]
X-Forwarded-Proto = 'https'

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

[[statics]]
guest_path = '/rails/public'
url_prefix = '/'

0 comments on commit 9395ad0

Please sign in to comment.