From 14e76dbd84488b86e94125b310bf18c54edafcec Mon Sep 17 00:00:00 2001 From: Jiaheng Pan Date: Wed, 9 Apr 2025 00:16:44 -0400 Subject: [PATCH] test CI/CD --- .github/workflows/main.yml | 20 +++++++++++++++++++- models/author.ts | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9877da5..108c9e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - deploy # Added deploy branch to trigger on push pull_request: branches: @@ -11,7 +12,7 @@ on: jobs: "run-jest-tests": - runs-on: cs5500-self-hosted + runs-on: self-hosted steps: - name: Checkout Repository uses: actions/checkout@v3 @@ -21,3 +22,20 @@ jobs: - name: Run Tests run: npm run test + + "setup-database": + runs-on: self-hosted + # Only run this job when pushing to deploy branch + if: github.event_name == 'push' && github.ref == 'refs/heads/deploy' + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Dependencies + run: npm install + + - name: Remove existing database + run: node remove_db.ts + + - name: Insert sample data + run: node insert_sample_db.ts \ No newline at end of file diff --git a/models/author.ts b/models/author.ts index 4c93157..ef49568 100644 --- a/models/author.ts +++ b/models/author.ts @@ -7,7 +7,7 @@ import mongoose, { Schema, Document, Model, FilterQuery } from 'mongoose'; * @property date_of_birth - The author's date of birth. * @property date_of_death - The author's date of death. * @property name - The author's full name. - * @property lifespan - The author's lifespan. + * @property lifespan - The author's lifespan. 'a small change to be removed' */ export interface IAuthor extends Document { first_name: string;