Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
- 'brokers/**'
- 'README.md'
- '.gitignore'
- 'Makefile'

pull_request:
branches: [ main ]
paths-ignore:
- 'brokers/**'
- 'README.md'
- '.gitignore'
- 'Makefile'

release:
types: [ published ]
Expand All @@ -30,8 +32,24 @@ on:

jobs:

build-local:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: npm run build
run: |
make node-build

- name: npm run preview
run: |
npm run preview -- --port 8080 & sleep 10; curl -f http://localhost:8080 || exit 1

build-test:
runs-on: ubuntu-latest
needs: build-local

steps:
- name: Checkout repository
Expand Down
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.PHONY: node-env-prep mongo-start mongo-stop mongo-restart mongo-reset node-build dev-start

mongo-start:
docker compose -f ./docker-compose-local.yml up -d mongo

mongo-stop:
docker compose -f ./docker-compose-local.yml down mongo

mongo-restart: mongo-stop mongo-start

mongo-reset: mongo-stop
docker rm -f tradenote_db
$(MAKE) mongo-start

node-env-prep:
. $$NVM_DIR/nvm.sh; nvm install 18
. $$NVM_DIR/nvm.sh; nvm use 18
. $$NVM_DIR/nvm.sh; nvm use 18; npm install

node-build: node-env-prep
. $$NVM_DIR/nvm.sh; nvm use 18; npm run build

dev-start: mongo-start node-build
. $$NVM_DIR/nvm.sh; nvm use 18; \
MONGO_URI=mongodb://tradenote:tradenote@localhost:27017/tradenote?authSource=admin \
TRADENOTE_DATABASE=tradenote APP_ID=123456 MASTER_KEY=123456 TRADENOTE_PORT=8080 \
npm run start