Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Overmind to bin/dev, implement Heroku deploy, and clean up Gemfile #86

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
pull_request:
branches:
- '*'
- "*"
push:
branches:
- main
Expand Down Expand Up @@ -37,7 +37,6 @@ jobs:
- name: Lint code for consistent style
run: bundle exec standardrb


test:
timeout-minutes: 10
runs-on: ubuntu-latest
Expand All @@ -48,15 +47,15 @@ jobs:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: test
ports: ['5432:5432']
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports: ['6379:6379']
ports: ["6379:6379"]
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
Expand All @@ -74,7 +73,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.tool-versions'
node-version-file: ".tool-versions"
cache: yarn

- name: Install dependencies
Expand All @@ -93,4 +92,18 @@ jobs:
bin/rails test:prepare
bin/rails db:test:prepare
bin/rails test
bin/rails test:system

deploy-development:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: [lint, test]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Deploy to Heroku
uses: akhileshns/[email protected]
with:
branch: main
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "phlex-ui-web"
heroku_email: "[email protected]"
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,5 @@ gem "rack-www" # used to redirect www to non-www subdomain
gem "rollbar"

gem "phlex-rails"
# gem "phlex_ui"
gem "phlex_ui", github: "PhlexUI/phlex_ui", branch: "main"
# gem "phlex_ui", path: "../phlex_ui"
gem "phlex_ui", git: "https://github.com/PhlexUI/phlex_ui.git", branch: "main"
17 changes: 10 additions & 7 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/usr/bin/env sh

if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi
#!/usr/bin/env bash

# Default to port 3000 if not specified
export PORT="${PORT:-3000}"

exec foreman start -f Procfile.dev "$@"
if command -v overmind &>/dev/null; then
exec overmind start -f Procfile.dev "$@"
else
if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi
foreman start -f Procfile.dev "$@"
fi