@@ -2,20 +2,17 @@ name: CI
22
33on :
44 pull_request :
5- types :
6- - opened
7- - reopened
8- - synchronize
9- - ready_for_review
105 push :
11- branches : " main"
6+ branches :
7+ - " main"
8+ - " released"
129jobs :
1310 test :
1411 runs-on : ubuntu-latest
1512
1613 steps :
1714 - name : Checkout code
18- uses : actions/checkout@v5
15+ uses : actions/checkout@v6
1916
2017 - name : Set up Ruby
2118 uses : ruby/setup-ruby@v1
2522 - name : Install pnpm
2623 uses : pnpm/action-setup@v4
2724 with :
25+ version : 10.8.0
2826 run_install : false
2927
3028 - name : Setup Node
@@ -40,10 +38,44 @@ jobs:
4038 run : bundle exec standardrb
4139
4240 - name : Run tests
43- run : |
44- bin/rails test:prepare
45- bin/rails db:test:prepare
46- bin/rails test
41+ run : bin/rails db:test:prepare test
42+
43+ verify_components :
44+ if : github.ref == 'refs/heads/main'
45+ runs-on : ubuntu-latest
46+
47+ steps :
48+ - name : Checkout code
49+ uses : actions/checkout@v6
50+
51+ - name : Set up Ruby
52+ uses : ruby/setup-ruby@v1
53+ with :
54+ bundler-cache : true
55+
56+ - name : Install pnpm
57+ uses : pnpm/action-setup@v4
58+ with :
59+ run_install : false
60+
61+ - name : Setup Node
62+ uses : actions/setup-node@v6
63+ with :
64+ node-version-file : " .node-version"
65+ cache : ' pnpm'
66+
67+ - name : Install dependencies
68+ run : pnpm install
69+
70+ - name : Build
71+ run : bin/rails g ruby_ui:component:all --force true
72+
73+ - uses : CatChen/check-git-status-action@v1
74+ with :
75+ fail-if-not-clean : true
76+ push-if-not-clean : false
77+ request-changes-if-not-clean : false
78+ targets : ' app'
4779
4880 docker-build :
4981 if : github.ref == 'refs/heads/main'
5486
5587 steps :
5688 - name : Checkout code
57- uses : actions/checkout@v5
89+ uses : actions/checkout@v6
5890
5991 - name : Login to GitHub Container Registry
6092 uses : docker/login-action@v3
@@ -73,13 +105,27 @@ jobs:
73105
74106 next-deploy :
75107 if : github.ref == 'refs/heads/main'
76- needs : [test, docker-build]
108+ needs : [test, docker-build, verify_components ]
77109 runs-on : ubuntu-latest
78110
79111 steps :
80112 - name : Checkout code
81- uses : actions/checkout@v5
113+ uses : actions/checkout@v6
82114 with :
83115 fetch-depth : 0
84- - name : Deploy to Heroku Prod
116+ - name : Deploy to Heroku Next
85117 run : git push https://heroku:${{ secrets.HEROKU_RUBYUI_API_KEY }}@git.heroku.com/rubyui-next.git HEAD:main
118+
119+
120+ released-deploy :
121+ if : github.ref == 'refs/heads/released'
122+ needs : [test]
123+ runs-on : ubuntu-latest
124+
125+ steps :
126+ - name : Checkout code
127+ uses : actions/checkout@v6
128+ with :
129+ fetch-depth : 0
130+ - name : Deploy to Heroku Prod
131+ run : git push https://heroku:${{ secrets.HEROKU_RUBYUI_API_KEY }}@git.heroku.com/rubyui.git HEAD:main
0 commit comments