From 1ffe64230859e5ff9fd69c0178106b0cd3fd5665 Mon Sep 17 00:00:00 2001 From: core Date: Thu, 21 Mar 2024 14:00:16 -0400 Subject: [PATCH] deploy via GH actions and not vercel automatics --- .github/workflows/deploy.yml | 36 +++++++++++++++++++++++++++++++++++ .github/workflows/migrate.yml | 20 ------------------- vercel.json | 5 ++++- 3 files changed, 40 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/migrate.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..522bff3 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Deploy tagged releases +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + # Pattern matched against refs/tags + tags: + - '*' # Push events to every tag not containing / +jobs: + migrate: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + - name: Install dependencies + run: npm install + - name: Apply all pending migrations to the database + run: npx prisma migrate deploy + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/migrate.yml b/.github/workflows/migrate.yml deleted file mode 100644 index 9a6131a..0000000 --- a/.github/workflows/migrate.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: migrate_db -on: - push: - branches: - - main - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - - name: Install dependencies - run: npm install - - name: Apply all pending migrations to the database - run: npx prisma migrate deploy - env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} diff --git a/vercel.json b/vercel.json index 6ed2852..0e8b061 100644 --- a/vercel.json +++ b/vercel.json @@ -3,5 +3,8 @@ "crons": [ { "path": "/api/cron/roster", "schedule": "0 * * * *" }, { "path": "/api/cron/connections", "schedule": "* * * * *" } - ] + ], + "git": { + "deploymentEnabled": false + } }