11
11
branches : " main"
12
12
jobs :
13
13
test :
14
- timeout-minutes : 15
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - name : Checkout code
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Set up Ruby
21
+ uses : ruby/setup-ruby@v1
22
+ with :
23
+ bundler-cache : true
24
+
25
+ - name : Install pnpm
26
+ uses : pnpm/action-setup@v4
27
+ with :
28
+ run_install : false
29
+
30
+ - name : Setup Node
31
+ uses : actions/setup-node@v4
32
+ with :
33
+ node-version-file : " .node-version"
34
+ cache : ' pnpm'
35
+
36
+ - name : Install dependencies
37
+ run : |
38
+ # sudo apt-get update
39
+ # sudo apt-get install -y -qq libvips
40
+ pnpm install
41
+
42
+ - name : Lint code for consistent style
43
+ run : bundle exec standardrb
44
+
45
+ - name : Build and run dev container task
46
+ uses :
devcontainers/[email protected]
47
+ with :
48
+ imageName : ghcr.io/ruby-ui/web-devcontainer
49
+ cacheFrom : ghcr.io/ruby-ui/web-devcontainer
50
+ push : always
51
+ runCmd : |
52
+ bundle exec standardrb
53
+ bin/rails test:prepare
54
+ bin/rails db:test:prepare
55
+ bin/rails test
56
+
57
+ docker-build :
58
+ if : github.ref == 'refs/heads/main'
15
59
runs-on : ubuntu-latest
16
60
permissions :
17
61
contents : read
@@ -34,36 +78,17 @@ jobs:
34
78
imageName : ghcr.io/ruby-ui/web-devcontainer
35
79
cacheFrom : ghcr.io/ruby-ui/web-devcontainer
36
80
push : always
37
- runCmd : |
38
- bundle exec standardrb
39
- bin/rails test:prepare
40
- bin/rails db:test:prepare
41
- bin/rails test
81
+
42
82
43
- heroku -deploy :
44
- if : ${{ github.event_name == 'push' && github. ref == 'refs/heads/PhlexUI-web' }}
45
- needs : [test]
83
+ next -deploy :
84
+ if : github.ref == 'refs/heads/main'
85
+ needs : [test, docker-build ]
46
86
runs-on : ubuntu-latest
47
87
48
88
steps :
49
- - uses : actions/checkout@v4
50
- - name : Deploy to Heroku
51
- uses :
akhileshns/[email protected]
89
+ - name : Checkout code
90
+ uses : actions/checkout@v4
52
91
with :
53
- branch : PhlexUI-web
54
- heroku_api_key : ${{secrets.HEROKU_API_KEY}}
55
- heroku_app_name : " phlex-ui-web"
56
-
57
-
58
- fly-deploy :
59
- if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
60
- needs : [test]
61
- name : Deploy app
62
- runs-on : ubuntu-latest
63
- concurrency : deploy-group
64
- steps :
65
- - uses : actions/checkout@v4
66
- - uses : superfly/flyctl-actions/setup-flyctl@master
67
- - run : flyctl deploy --remote-only
68
- env :
69
- FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
92
+ fetch-depth : 0
93
+ - name : Deploy to Heroku Prod
94
+ run : git push https://heroku:${{ secrets.HEROKU_RUBYUI_API_KEY }}@git.heroku.com/rubyui-next.git HEAD:main
0 commit comments