diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..5c0ffab --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,53 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "18" + + - name: pnpm-setup + uses: pnpm/action-setup@v2 + + - name: Install dependencies + run: pnpm i + + - name: Deploy + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} + + NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} + NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} + + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + FACEBOOK_CLIENT_ID: ${{ secrets.FACEBOOK_CLIENT_ID }} + FACEBOOK_CLIENT_SECRET: ${{ secrets.FACEBOOK_CLIENT_SECRET }} + + EMAIL_SERVER_USER: ${{ secrets.EMAIL_SERVER_USER }} + EMAIL_SERVER_PASSWORD: ${{ secrets.EMAIL_SERVER_PASSWORD }} + EMAIL_SERVER_HOST: ${{ secrets.EMAIL_SERVER_HOST }} + EMAIL_SERVER_PORT: ${{ secrets.EMAIL_SERVER_PORT }} + EMAIL_FROM: ${{ secrets.EMAIL_FROM }} + + CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} + + S3_BUCKET_ARN: ${{ secrets.S3_BUCKET_ARN }} + S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} + NEXT_PUBLIC_POSTS_PER_PAGE: ${{ vars.NEXT_PUBLIC_POSTS_PER_PAGE}} + run: | + pnpm postinstall && pnpm sst deploy --stage prod diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 489605b..7dbc66a 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -8,7 +8,6 @@ import Header from "~/components/Header"; import NextNProgress from "nextjs-progressbar"; import { Poppins, Playfair_Display } from "next/font/google"; -import Script from "next/script"; const poppins = Poppins({ subsets: ["latin"], diff --git a/src/pages/api/getSignedURLS.ts b/src/pages/api/getSignedURLS.ts index bdb989d..b3f72ee 100644 --- a/src/pages/api/getSignedURLS.ts +++ b/src/pages/api/getSignedURLS.ts @@ -1,6 +1,6 @@ import { Role } from "@prisma/client"; import type { NextApiRequest, NextApiResponse } from "next"; -import { z, TypeOf } from "zod"; +import { z, type TypeOf } from "zod"; import { getServerAuthSession } from "~/server/auth"; import { getSignedURLS } from "~/server/helpers"; diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index dd42490..add76c5 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,6 +1,6 @@ import { parseISO, format } from "date-fns"; import crypto from "crypto"; -import { ChangeEvent, Dispatch, SetStateAction } from "react"; +import type { ChangeEvent, Dispatch, SetStateAction } from "react"; export function formatDate(inputDate: string) { const date = parseISO(inputDate);