diff --git a/.github/workflows/merge-request.yaml b/.github/workflows/merge-request.yaml index 51b7032..0745fd8 100644 --- a/.github/workflows/merge-request.yaml +++ b/.github/workflows/merge-request.yaml @@ -1,25 +1,56 @@ -name: Merge Request Quality Gate +name: Deploy to Vercel on: pull_request jobs: - lint-and-build: + # lint-and-test: + # runs-on: ubuntu-latest + + # steps: + # - name: Checkout code + # uses: actions/checkout@v3 + + # - name: Set up Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: 20 + + # - name: Install dependencies + # run: yarn + + # - name: Run lint + # run: yarn lint + + # - name: Run tests + # run: yarn test + + build-and-deploy: runs-on: ubuntu-latest - name: Lint and build + environment: Production + needs: lint-and-test steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 - - name: Setup node 20 - uses: actions/setup-node@v3 - with: - node-version: 20.x + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 20 - - name: Install dependencies - run: yarn + - name: Install dependencies + run: echo ${{ secrets.DATABASE_URL }} + + - name: Install dependencies + run: echo ${{ secrets.DATABASE_URL }} > .env - - name: Lint code - run: yarn lint + - name: Install dependencies + run: yarn + + - name: Run database migrations + run: yarn migrate - - name: Check build - run: yarn build + - name: Deploy to Vercel + run: vercel --prod + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} diff --git a/.vscode/settings.json b/.vscode/settings.json index 5da11b4..1c3519f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,5 +13,5 @@ "[json]": { "editor.defaultFormatter": "biomejs.biome" }, - "cSpell.words": ["biomejs", "lefthook", "tailwindcss"] + "cSpell.words": ["biomejs", "lefthook", "tailwindcss", "Vercel"] } diff --git a/package.json b/package.json index 18f334f..cf37a4f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "next build", "start": "next start", "lint": "biome check", + "migrate": "prisma migrate dev", "format": "biome format", "postinstall": "prisma generate" },