diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3a421e6 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,58 @@ +name: MAIN CI + +on: + push: + branches: + - main + +jobs: + Deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout source code + uses: actions/checkout@v3 + + - name: Install pnpm + run: | + npm install -g pnpm + + - name: Get pnpm store path + id: pnpm-cache-path + run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV + + - name: Cache pnpm modules + id: cache + uses: actions/cache@v3 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- + ${{ runner.os }}- + + - name: Install Dependencies + run: | + pnpm install --frozen-lockfile + pnpm store prune + + - name: Set up .env file + run: | + echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" > .env.production + echo "HTTPS=true" >> .env.production + + - name: Build + run: pnpm run build + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Deploy to S3 + run: aws s3 sync ./dist s3://${{ secrets.AWS_BUCKET_NAME }} --delete + + - name: Invalidate CloudFront Cache + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/*" diff --git a/src/main.tsx b/src/main.tsx index 8b87556..4df6fa6 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -15,11 +15,11 @@ queryClient.setDefaultOptions({ }); createRoot(document.getElementById('root')!).render( - // - - - - - , - // + + + + + + + , ); diff --git a/src/pages/Auth/index.tsx b/src/pages/Auth/index.tsx index 20c691d..cb562af 100644 --- a/src/pages/Auth/index.tsx +++ b/src/pages/Auth/index.tsx @@ -75,6 +75,9 @@ const AuthCallbackPage = () => { return; } navigate('/notFound'); + if (error === 'deleted_member') { + alert('탈퇴한 회원입니다.'); + } return; } diff --git a/src/pages/LetterBoardDetail/index.tsx b/src/pages/LetterBoardDetail/index.tsx index 0970413..4a9de3a 100644 --- a/src/pages/LetterBoardDetail/index.tsx +++ b/src/pages/LetterBoardDetail/index.tsx @@ -4,8 +4,8 @@ import { twMerge } from 'tailwind-merge'; import { getSharePostDetail, SharePost, - postSharePostLike, getSharePostLikeCount, + postSharePostLike, } from '@/apis/share'; import ReportModal from '@/components/ReportModal'; @@ -20,6 +20,9 @@ const LetterBoardDetailPage = () => { const [isWriter, setIsWriter] = useState(false); const [postDetail, setPostDetail] = useState(); const [activeReportModal, setActiveReportModal] = useState(false); + // const location = useLocation(); + // const sharePostId: string = location.pathname.split('/')[3]; + // const isShareLetterPreview = location.state?.isShareLetterPreview || false; const { id } = useParams();