From 8d8c1ec6971380bc20f5c159585921e57683162b Mon Sep 17 00:00:00 2001 From: Joydeep Mitra Date: Tue, 8 Apr 2025 12:58:29 -0400 Subject: [PATCH 1/3] prepare handout 02 --- .github/workflows/setupDeploy.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/setupDeploy.yml diff --git a/.github/workflows/setupDeploy.yml b/.github/workflows/setupDeploy.yml deleted file mode 100644 index 81e5a12..0000000 --- a/.github/workflows/setupDeploy.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Prepare Database - -on: - push: - branches: - - deploy - -jobs: - "setup-database": - runs-on: cs5500-self-hosted - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - - name: Install Dependencies - run: npm install - - - name: Delete old database - run: npm run remove-sample-data -- "mongodb://127.0.0.1:27017/my_library_db" - - - name: Seed database - run: npm run insert-sample-data -- "mongodb://127.0.0.1:27017/my_library_db" \ No newline at end of file From a571f5d6aad53515d140043fdbfcfc1b3bc1198b Mon Sep 17 00:00:00 2001 From: Ethan Coomber Date: Tue, 8 Apr 2025 14:44:35 -0400 Subject: [PATCH 2/3] Add deploy workflow --- .github/workflows/setupDeploy.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/setupDeploy.yml diff --git a/.github/workflows/setupDeploy.yml b/.github/workflows/setupDeploy.yml new file mode 100644 index 0000000..10d41cf --- /dev/null +++ b/.github/workflows/setupDeploy.yml @@ -0,0 +1,25 @@ +name: Setup and Deploy + +on: + push: + branches: + - deploy + pull_request: + branches: + - deploy + +jobs: + setup-and-deploy: + runs-on: self-hosted # or cs5500-self-hosted if that's how it's named on your runner + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Dependencies + run: npm install + + - name: Remove Existing DB + run: npx ts-node scripts/remove_db.ts + + - name: Insert Sample DB + run: npx ts-node scripts/insert_sample_db.ts From d5fa4700aecf385e21b9f6808065c0c52e72b77b Mon Sep 17 00:00:00 2001 From: Ethan Coomber Date: Tue, 8 Apr 2025 14:48:44 -0400 Subject: [PATCH 3/3] updated scripts --- .github/workflows/setupDeploy.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/setupDeploy.yml b/.github/workflows/setupDeploy.yml index 10d41cf..e1cfe40 100644 --- a/.github/workflows/setupDeploy.yml +++ b/.github/workflows/setupDeploy.yml @@ -4,13 +4,10 @@ on: push: branches: - deploy - pull_request: - branches: - - deploy jobs: setup-and-deploy: - runs-on: self-hosted # or cs5500-self-hosted if that's how it's named on your runner + runs-on: self-hosted steps: - name: Checkout Repository uses: actions/checkout@v3 @@ -19,7 +16,7 @@ jobs: run: npm install - name: Remove Existing DB - run: npx ts-node scripts/remove_db.ts + run: npx ts-node remove_db.ts - name: Insert Sample DB - run: npx ts-node scripts/insert_sample_db.ts + run: npx ts-node insert_sample_db.ts