From cc678890f38053212b3180f76cb2ac522024082b Mon Sep 17 00:00:00 2001 From: Cirdes Date: Thu, 20 Nov 2025 17:42:40 +0000 Subject: [PATCH 1/3] Unify GitHub Actions workflows and add production deployment support --- .github/workflows/{main.yml => ci.yml} | 75 ++++++++++++++++++++----- .github/workflows/deploy.yml | 17 ------ .github/workflows/verify_components.yml | 42 -------------- Gemfile | 1 - Gemfile.lock | 3 - 5 files changed, 60 insertions(+), 78 deletions(-) rename .github/workflows/{main.yml => ci.yml} (53%) delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/verify_components.yml diff --git a/.github/workflows/main.yml b/.github/workflows/ci.yml similarity index 53% rename from .github/workflows/main.yml rename to .github/workflows/ci.yml index b127da20..bf7db365 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/ci.yml @@ -2,20 +2,17 @@ name: CI on: pull_request: - types: - - opened - - reopened - - synchronize - - ready_for_review push: - branches: "main" + branches: + - "main" + - "released" jobs: test: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 @@ -25,6 +22,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 with: + version: 10.8.0 run_install: false - name: Setup Node @@ -40,10 +38,43 @@ jobs: run: bundle exec standardrb - name: Run tests - run: | - bin/rails test:prepare - bin/rails db:test:prepare - bin/rails test + run: bin/rails db:test:prepare test + + verify_components: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + run_install: false + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version-file: ".node-version" + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build + run: bin/rails g ruby_ui:component:all --force true + + - uses: CatChen/check-git-status-action@v1 + with: + fail-if-not-clean: true + push-if-not-clean: false + request-changes-if-not-clean: false + targets: 'app' docker-build: if: github.ref == 'refs/heads/main' @@ -54,7 +85,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -73,13 +104,27 @@ jobs: next-deploy: if: github.ref == 'refs/heads/main' - needs: [test, docker-build] + needs: [test, docker-build, verify_components] runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 - - name: Deploy to Heroku Prod + - name: Deploy to Heroku Next run: git push https://heroku:${{ secrets.HEROKU_RUBYUI_API_KEY }}@git.heroku.com/rubyui-next.git HEAD:main + + + released-deploy: + if: github.ref == 'refs/heads/released' + needs: [test] + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Deploy to Heroku Prod + run: git push https://heroku:${{ secrets.HEROKU_RUBYUI_API_KEY }}@git.heroku.com/rubyui.git HEAD:main diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index e8252856..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,17 +0,0 @@ -# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ - -name: Deploy -on: - workflow_dispatch: - -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@v5 - - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --remote-only - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/.github/workflows/verify_components.yml b/.github/workflows/verify_components.yml deleted file mode 100644 index 26280d4a..00000000 --- a/.github/workflows/verify_components.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Verify components - -on: - push: - branches: "main" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - run_install: false - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version-file: ".node-version" - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install - - - name: Build - run: bin/rails g ruby_ui:component:all --force true - - - uses: CatChen/check-git-status-action@v1 - with: - fail-if-not-clean: true - push-if-not-clean: false - request-changes-if-not-clean: false - targets: 'app' diff --git a/Gemfile b/Gemfile index f50f71f6..ab67e0cb 100644 --- a/Gemfile +++ b/Gemfile @@ -62,7 +62,6 @@ group :development do # Speed up commands on slow machines / big apps [https://github.com/rails/spring] # gem "spring" gem "standard" - gem "dockerfile-rails", ">= 1.6" end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index d58e7982..ab099810 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -124,8 +124,6 @@ GEM debug (1.11.0) irb (~> 1.10) reline (>= 0.3.8) - dockerfile-rails (1.7.10) - rails (>= 3.0.0) drb (2.2.3) erb (6.0.0) erubi (1.13.1) @@ -332,7 +330,6 @@ DEPENDENCIES capybara cssbundling-rails (= 1.4.3) debug - dockerfile-rails (>= 1.6) jsbundling-rails (= 1.3.1) lucide-rails (= 0.7.1) phlex! From 28aa0523b2b1d1bd909364e552bc946b550937b3 Mon Sep 17 00:00:00 2001 From: Cirdes Date: Thu, 20 Nov 2025 17:44:54 +0000 Subject: [PATCH 2/3] Upgrade GitHub Actions to v6 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf7db365..8a78bf67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 From bfe24029b87b161ed89044ef8bee2c16ebb0527e Mon Sep 17 00:00:00 2001 From: Cirdes Date: Thu, 20 Nov 2025 17:48:57 +0000 Subject: [PATCH 3/3] fix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a78bf67..d2f29765 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,7 @@ jobs: run: bin/rails db:test:prepare test verify_components: + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: