From a769b68755f9c97537bcc8ed37fc713341bf0977 Mon Sep 17 00:00:00 2001 From: Rachana Kallada Jayaraj Date: Wed, 9 Apr 2025 21:00:01 -0400 Subject: [PATCH 1/2] Fix script paths for sample DB setup --- .github/workflows/deploy.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8674b8e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,30 @@ +name: Deploy Branch CI + +on: + push: + branches: + - deploy + +jobs: + setup-and-test: + runs-on: self-hosted + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Run Jest tests + run: npm test + + - name: Seed sample database + run: | + npx ts-node remove_db.ts + npx ts-node insert_sample_data.ts From 34923d43605f2533a6999b23529d66fab09cc57c Mon Sep 17 00:00:00 2001 From: Rachana Kallada Jayaraj Date: Wed, 9 Apr 2025 21:07:27 -0400 Subject: [PATCH 2/2] Fix script paths for sample DB setup --- .github/workflows/deploy.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8674b8e..ad09ccc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,6 +25,8 @@ jobs: run: npm test - name: Seed sample database + env: + MONGO_URI: ${{ secrets.MONGO_URI }} run: | - npx ts-node remove_db.ts - npx ts-node insert_sample_data.ts + npx ts-node remove_db.ts "$MONGO_URI" + npx ts-node insert_sample_data.ts "$MONGO_URI"