@@ -236,14 +236,15 @@ jobs:
236
236
password : ${{ secrets.DEPLOYER_PASSWORD }}
237
237
data : ' { "service":"${{ env.ESM_NAME }}","url":"https://donaldkibet.fra1.digitaloceanspaces.com/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/${{ env.JS_NAME }}" }'
238
238
customHeaders : ' { "Accept": "application/json", "Content-Type": "application/json" }'
239
+
239
240
240
- deploy_patient_list_app :
241
+ deploy_active_visits_app :
241
242
runs-on : ubuntu-latest
242
243
243
244
env :
244
- DIR_NAME : " esm-patient-list -app"
245
- ESM_NAME : " @openmrs/esm-patient-list -app"
246
- JS_NAME : " openmrs-esm-patient-list -app.js"
245
+ DIR_NAME : " esm-active-visits -app"
246
+ ESM_NAME : " @openmrs/esm-active-visits -app"
247
+ JS_NAME : " openmrs-esm-active-visits -app.js"
247
248
248
249
needs : build
249
250
@@ -261,7 +262,6 @@ jobs:
261
262
run : |
262
263
mkdir -p dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}
263
264
mv packages/${{ env.DIR_NAME }}/dist/*.* dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/
264
-
265
265
- name : Publish to Digital Ocean
266
266
uses : jakejarvis/s3-sync-action@master
267
267
with :
@@ -272,7 +272,6 @@ jobs:
272
272
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
273
273
AWS_S3_ENDPOINT : ${{ secrets.AWS_S3_ENDPOINT }}
274
274
SOURCE_DIR : " dist"
275
-
276
275
- name : Update Importmap
277
276
uses : fjogeleit/http-request-action@master
278
277
with :
@@ -283,13 +282,13 @@ jobs:
283
282
data : ' { "service":"${{ env.ESM_NAME }}","url":"https://donaldkibet.fra1.digitaloceanspaces.com/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/${{ env.JS_NAME }}" }'
284
283
customHeaders : ' { "Accept": "application/json", "Content-Type": "application/json" }'
285
284
286
- deploy_patient_registration_app :
285
+ deploy_patient_search_app :
287
286
runs-on : ubuntu-latest
288
287
289
288
env :
290
- DIR_NAME : " esm-patient-registration -app"
291
- ESM_NAME : " @openmrs/esm-patient-registration -app"
292
- JS_NAME : " openmrs-esm-patient-registration -app.js"
289
+ DIR_NAME : " esm-patient-search -app"
290
+ ESM_NAME : " @openmrs/esm-patient-search -app"
291
+ JS_NAME : " openmrs-esm-patient-search -app.js"
293
292
294
293
needs : build
295
294
@@ -328,74 +327,94 @@ jobs:
328
327
password : ${{ secrets.DEPLOYER_PASSWORD }}
329
328
data : ' { "service":"${{ env.ESM_NAME }}","url":"https://donaldkibet.fra1.digitaloceanspaces.com/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/${{ env.JS_NAME }}" }'
330
329
customHeaders : ' { "Accept": "application/json", "Content-Type": "application/json" }'
331
-
332
- pre_release :
330
+ deploy_patient_list_app :
333
331
runs-on : ubuntu-latest
334
332
333
+ env :
334
+ DIR_NAME : " esm-patient-list-app"
335
+ ESM_NAME : " @openmrs/esm-patient-list-app"
336
+ JS_NAME : " openmrs-esm-patient-list-app.js"
337
+
335
338
needs : build
336
339
337
340
if : ${{ github.event_name == 'push' }}
338
341
339
342
steps :
340
- - uses : actions/checkout@v3
341
- - name : Setup Node.js
342
- uses : actions/setup-node@v1
343
- with :
344
- node-version : " 16.15"
345
- registry-url : " https://registry.npmjs.org"
346
-
347
- - name : Cache dependencies
348
- id : cache
349
- uses : actions/cache@v3
343
+ - name : Download Artifacts
344
+ uses : actions/download-artifact@v2
345
+
346
+ - name : Compute Timestamp
347
+ run : echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
348
+
349
+ - name : Prepare Directory
350
+ shell : bash
351
+ run : |
352
+ mkdir -p dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}
353
+ mv packages/${{ env.DIR_NAME }}/dist/*.* dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/
354
+
355
+ - name : Publish to Digital Ocean
356
+ uses : jakejarvis/s3-sync-action@master
350
357
with :
351
- path : ' **/node_modules'
352
- key : ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
353
-
354
- - name : Install dependencies
355
- if : steps.cache.outputs.cache-hit != 'true'
356
- run : yarn install --immutable
357
-
358
- - run : yarn lerna version "$(node -e "console.log(require('semver').inc(require('./lerna.json').version, 'patch'))")-pre.${{ github.run_number }}" --no-git-tag-version --no-push --yes
359
- - run : yarn turbo run build --color
360
- - run : git config user.email "info@openmrs.org" && git config user.name "OpenMRS CI"
361
- - run : git add . && git commit -m "Prerelease version" --no-verify
362
- - run : yarn run ci:prepublish
358
+ args : --acl public-read --follow-symlinks --cache-control "max-age=31536000"
363
359
env :
364
- NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
365
- - name : Upload Artifacts
366
- uses : actions/upload-artifact@v2
360
+ AWS_S3_BUCKET : ${{ secrets.AWS_S3_BUCKET }}
361
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
362
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
363
+ AWS_S3_ENDPOINT : ${{ secrets.AWS_S3_ENDPOINT }}
364
+ SOURCE_DIR : " dist"
365
+
366
+ - name : Update Importmap
367
+ uses : fjogeleit/http-request-action@master
367
368
with :
368
- name : packages
369
- path : |
370
- packages/**/dist
369
+ url : http://${{ secrets.DEPLOYER_HOST }}/services?env=prod
370
+ method : " PATCH"
371
+ username : ${{ secrets.DEPLOYER_USERNAME }}
372
+ password : ${{ secrets.DEPLOYER_PASSWORD }}
373
+ data : ' { "service":"${{ env.ESM_NAME }}","url":"https://donaldkibet.fra1.digitaloceanspaces.com/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/${{ env.JS_NAME }}" }'
374
+ customHeaders : ' { "Accept": "application/json", "Content-Type": "application/json" }'
371
375
372
- release :
376
+ deploy_patient_registration_app :
373
377
runs-on : ubuntu-latest
374
378
379
+ env :
380
+ DIR_NAME : " esm-patient-registration-app"
381
+ ESM_NAME : " @openmrs/esm-patient-registration-app"
382
+ JS_NAME : " openmrs-esm-patient-registration-app.js"
383
+
375
384
needs : build
376
385
377
- if : ${{ github.event_name == 'release ' }}
386
+ if : ${{ github.event_name == 'push ' }}
378
387
379
388
steps :
380
- - uses : actions/checkout@v3
381
- - name : Setup Node.js
382
- uses : actions/setup-node@v3
383
- with :
384
- node-version : " 16.15"
385
- registry-url : " https://registry.npmjs.org"
386
-
387
- - name : Cache dependencies
388
- id : cache
389
- uses : actions/cache@v3
389
+ - name : Download Artifacts
390
+ uses : actions/download-artifact@v2
391
+
392
+ - name : Compute Timestamp
393
+ run : echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
394
+
395
+ - name : Prepare Directory
396
+ shell : bash
397
+ run : |
398
+ mkdir -p dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}
399
+ mv packages/${{ env.DIR_NAME }}/dist/*.* dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/
400
+
401
+ - name : Publish to Digital Ocean
402
+ uses : jakejarvis/s3-sync-action@master
390
403
with :
391
- path : ' **/node_modules'
392
- key : ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
393
-
394
- - name : Install dependencies
395
- if : steps.cache.outputs.cache-hit != 'true'
396
- run : yarn install --immutable
397
-
398
- - run : yarn turbo run build --color
399
- - run : yarn run ci:publish
404
+ args : --acl public-read --follow-symlinks --cache-control "max-age=31536000"
400
405
env :
401
- NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
406
+ AWS_S3_BUCKET : ${{ secrets.AWS_S3_BUCKET }}
407
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
408
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
409
+ AWS_S3_ENDPOINT : ${{ secrets.AWS_S3_ENDPOINT }}
410
+ SOURCE_DIR : " dist"
411
+
412
+ - name : Update Importmap
413
+ uses : fjogeleit/http-request-action@master
414
+ with :
415
+ url : http://${{ secrets.DEPLOYER_HOST }}/services?env=prod
416
+ method : " PATCH"
417
+ username : ${{ secrets.DEPLOYER_USERNAME }}
418
+ password : ${{ secrets.DEPLOYER_PASSWORD }}
419
+ data : ' { "service":"${{ env.ESM_NAME }}","url":"https://donaldkibet.fra1.digitaloceanspaces.com/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/${{ env.JS_NAME }}" }'
420
+ customHeaders : ' { "Accept": "application/json", "Content-Type": "application/json" }'
0 commit comments