Skip to content

Commit b86e3ea

Browse files
committed
Make verify ci workflow work without github secrets
1 parent 636571b commit b86e3ea

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

.github/workflows/verify.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ jobs:
5555
test:
5656
name: Tests
5757
runs-on: ubuntu-latest
58-
env:
59-
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_TEST_KEY }}
6058

6159
steps:
6260
- name: Checkout code
@@ -159,8 +157,6 @@ jobs:
159157
npm-test:
160158
name: Tests - JavaScript
161159
runs-on: ubuntu-latest
162-
env:
163-
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_TEST_KEY }}
164160

165161
steps:
166162
- name: Checkout code
@@ -196,7 +192,6 @@ jobs:
196192
assets:
197193
name: Assets
198194
runs-on: ubuntu-latest
199-
200195
steps:
201196
- name: Checkout code
202197
uses: actions/checkout@v4
@@ -226,8 +221,6 @@ jobs:
226221
227222
- name: Make sure assets compile
228223
run: |
229-
RAILS_MASTER_KEY=${{ secrets.RAILS_MASTER_PRODUCTION_KEY }} \
230-
RAILS_ENV=production \
231224
bin/rails assets:precompile
232225
233226
- uses: actions/upload-artifact@v4
@@ -240,7 +233,7 @@ jobs:
240233
name: Boot
241234
runs-on: ubuntu-latest
242235
env:
243-
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_PRODUCTION_KEY }}
236+
RAILS_MASTER_PRODUCTION_KEY: ${{ secrets.RAILS_MASTER_PRODUCTION_KEY }}
244237
steps:
245238
- name: Checkout code
246239
uses: actions/checkout@v4
@@ -268,11 +261,24 @@ jobs:
268261
run: |
269262
bin/sqlpkg install
270263
271-
- name: Start Rails server in the background
264+
- name: Start Rails server in the background (test)
265+
run: |
266+
bundle exec puma -b tcp://127.0.0.1:3001 -e test &
267+
268+
- name: Start Rails server in the background (production)
269+
if: ${{ env.RAILS_MASTER_PRODUCTION_KEY != '' }}
272270
run: |
273-
RAILS_FORCE_SSL=false bundle exec puma -b tcp://127.0.0.1:3001 -e production &
274-
sleep 10
271+
RAILS_MASTER_KEY=$RAILS_MASTER_PRODUCTION_KEY \
272+
RAILS_FORCE_SSL=false bundle exec puma -b tcp://127.0.0.1:3002 -e production &
273+
274+
- name: Wait for the servers to start
275+
run: sleep 10
275276

276-
- name: Make sure the server is running
277+
- name: Make sure the server is running (test)
277278
run: |
278279
bin/up http://127.0.0.1:3001/up
280+
281+
- name: Make sure the server is running (production)
282+
if: ${{ env.RAILS_MASTER_PRODUCTION_KEY != '' }}
283+
run: |
284+
bin/up http://127.0.0.1:3002/up

0 commit comments

Comments
 (0)