-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* trying to deploy to fly.io TODO: figure out secrets/db config for production
- Loading branch information
1 parent
f589463
commit 3485f32
Showing
7 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ | ||
|
||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,3 +61,54 @@ started below this list: | |
Before you move on, we would love it if you could send us your feedback on the | ||
Ruby on Rails course. Getting user (you) feedback is important so we can | ||
continue to improve the curriculum and get an idea of your experience. | ||
|
||
## Issues | ||
|
||
After running `fly launch`: | ||
|
||
```bash | ||
Save your credentials in a secure place -- you won't be able to see them again! | ||
Connect to postgres | ||
Any app within the Sean Garwood organization can connect to this Postgres using the above connection string | ||
Now that you've set up Postgres, here's what you need to understand: <https://fly.io/docs/postgres/getting-started/what-you-should-know/> | ||
Checking for existing attachments | ||
Registering attachment | ||
Creating database | ||
Creating user | ||
Postgres cluster top-odinbook-db is now attached to top-odinbook | ||
The following secret was added to top-odinbook: | ||
DATABASE_URL=postgres://top_odinbook:<[email protected]>:5432/top_odinbook?sslmode=disable | ||
Postgres cluster top-odinbook-db is now attached to top-odinbook | ||
Fetching gem metadata from <https://rubygems.org/>......... | ||
Resolving dependencies... | ||
WARN: Unresolved or ambiguous specs during Gem::Specification.reset: | ||
stringio (>= 0) | ||
Available/installed versions of this gem: | ||
- 3.1.2 | ||
- 3.1.1 | ||
WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>' | ||
Please report a bug if this causes problems. | ||
Running: bin/rails generate dockerfile --label=fly_launch_runtime:rails --skip --postgresql --no-prepare | ||
skip Dockerfile | ||
skip .dockerignore | ||
skip bin/docker-entrypoint | ||
create config/dockerfile.yml | ||
Wrote config file fly.toml | ||
Validating /home/ssg/courses/top/rails/projects/top_odinbook/fly.toml | ||
✓ Configuration is valid | ||
Your Rails app is prepared for deployment. | ||
WARNING: One or more of your config initializer files appears to access | ||
environment variables or Rails credentials. These values generally are not | ||
available during the Docker build process, so you may need to update your | ||
initializers to bypass portions of your setup during the build process. | ||
More information on what needs to be done can be found at: | ||
<https://fly.io/docs/rails/getting-started/existing/#access-to-environment-variables-at-build-time>. | ||
Once ready: run 'fly deploy' to deploy your Rails app. | ||
``` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# fly.toml app configuration file generated for top-odinbook on 2024-11-20T20:23:01-05:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'top-odinbook' | ||
primary_region = 'ewr' | ||
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 = 'stop' | ||
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 = '/' |