Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
sommeeeer committed Jan 20, 2024
1 parent b1b8faf commit c5e585f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/getSignedURLS.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit c5e585f

Please sign in to comment.