diff --git a/.github/workflows/dev-stage.yaml b/.github/workflows/dev-stage.yaml index 356a3fc..c5f9b08 100644 --- a/.github/workflows/dev-stage.yaml +++ b/.github/workflows/dev-stage.yaml @@ -36,9 +36,13 @@ jobs: run: | export DB_URL=$(neonctl connection-string --branch dev --api-key ${{ env.API_KEY }}) npx tsx src/cli/putSecrets.js dev $DB_URL - - name: Branch Info + - name: Deploy dev stage + run: | + npm run deploy-dev-stage + - name: Dev Stage Pull Request run: | export PR_BRANCH=$(git branch --show-current) export DEFAULT_BRANCH=$(git remote show origin | awk '/HEAD branch/ {print $NF}') echo "$PR_BRANCH and $DEFAULT_BRANCH" - gh pr create --title "Automated PR from Dev Stage" --body "Coming Soon" --base $DEFAULT_BRANCH --head $PR_BRANCH --repo $GITHUB_REPOSITORY \ No newline at end of file + export DEV_STAGE_INFO=$(npm run info-dev-stage) + gh pr create --title "Automated PR from Dev Stage" --body "$DEV_STAGE_INFO" --base $DEFAULT_BRANCH --head $PR_BRANCH --repo $GITHUB_REPOSITORY \ No newline at end of file diff --git a/package.json b/package.json index 10da4de..73fd69b 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "dev": "serverless offline --stage dev", "info": "serverless info --stage prod --region us-east-2", "deploy": "serverless deploy --stage prod --region us-east-2", + "deploy-dev-stage": "serverless deploy --stage dev --region us-east-2", + "info-dev-stage": "serverless info --stage prod --region us-east-2", "remove": "serverless remove --stage prod --region us-east-2", "generate": "drizzle-kit generate:pg --config=drizzle.config.js", "migrate": "tsx src/cli/migrator.js" diff --git a/src/index.js b/src/index.js index 15204d8..23fdc1f 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ const app = express(); const STAGE = process.env.STAGE || 'prod' app.use(express.json()) + app.get("/", async (req, res, next) => { console.log(process.env.DEBUG ) const sql = await getDbClient() @@ -27,7 +28,7 @@ app.get("/path", (req, res, next) => { app.get("/leads", async (req, res, next) => { - const results = await crud.getLeads() + const results = await crud.listLeads() return res.status(200).json({ results: results, });