Skip to content

Commit

Permalink
Merge pull request #86 from PhlexUI/qol-improvements
Browse files Browse the repository at this point in the history
Add Overmind to bin/dev, implement Heroku deploy, and clean up Gemfile
  • Loading branch information
SethHorsley authored Jul 17, 2024
2 parents 2ff0c5a + d780605 commit ab49050
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
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

0 comments on commit ab49050

Please sign in to comment.