Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
deployment_url:
required: true
type: string
aws_role_arn:
cf_project_name:
required: true
type: string

Expand All @@ -16,8 +16,7 @@ jobs:
name: Deploy (${{ inputs.environment }})
runs-on: ubuntu-latest
permissions:
id-token: write # Needed for AWS OIDC
contents: read # Needed to check out the repository
contents: read
environment:
name: ${{ inputs.environment }}
url: ${{ inputs.deployment_url }}
Expand All @@ -33,8 +32,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22" # Or your preferred Node.js version
cache: "pnpm" # Cache pnpm dependencies
node-version: "22"
cache: "pnpm"

- name: Install dependencies
run: pnpm install
Expand All @@ -57,6 +56,7 @@ jobs:
VITE_ENABLE_REGISTER: ${{ vars.ENABLE_REGISTER }}
VITE_ENABLE_KAKAO_PAYMENTS: ${{ vars.ENABLE_KAKAO_PAYMENTS }}
VITE_ENABLE_CONNECTION_INFO: ${{ vars.ENABLE_CONNECTION_INFO }}
VITE_ENABLE_TIMESALE_TOOLTIP: ${{ vars.ENABLE_TIMESALE_TOOLTIP }}
VITE_DISABLED_PROFILE_VIEW_DESC: ${{ vars.DISABLED_PROFILE_VIEW_DESC }}
VITE_DISABLED_REGISTER_DESC: ${{ vars.DISABLED_REGISTER_DESC }}
VITE_SHA: ${{ github.sha }}
Expand All @@ -67,16 +67,17 @@ jobs:
VITE_PROFILE_ANALYSIS_WRITINGS: ${{ vars.PROFILE_ANALYSIS_WRITINGS }}
VITE_DATA_EXPIRY: ${{ vars.DATA_EXPIRY }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.aws_role_arn}}
aws-region: ap-northeast-2 # Specify your AWS region

- name: Upload to S3
run: |
aws s3 sync ./dist s3://${{ vars.S3_BUCKET_NAME }} --delete
- name: Create Cloudflare Pages project (if not exists)
run: npx wrangler pages project create ${{ inputs.cf_project_name }} --production-branch main || true
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}

- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ vars.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ inputs.cf_project_name }}
directory: dist
branch: main
39 changes: 31 additions & 8 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import React from "react";
import { Link, To } from "react-router";
import { Button, buttonVariants } from "@/components/ui/button";
import {
Tooltip,
TooltipTrigger,
TooltipContent,
} from "@/components/ui/tooltip";
import { ChevronLeft } from "lucide-react";
import { cn } from "@/lib/utils";
import { useViewerSelf } from "@/hooks/queries/viewers";
import { ENABLE_TIMESALE_TOOLTIP } from "@/env";
import userIcon from "@/assets/icons/user_icon.svg";

interface TopBarProps {
Expand All @@ -19,6 +25,16 @@ const TopBar: React.FC<TopBarProps> = ({ onBack, hideInfo, purchaseLink }) => {
onBack();
}
};

const purchaseLinkEl = purchaseLink ? (
<Link
to={purchaseLink}
className="bg-white border border-gray-200 rounded-full px-2.5 py-1 text-[10px] font-semibold text-[#767a83]"
>
이용권 구매
</Link>
) : null;

return (
<div className="w-full h-13 pl-2 pr-6 shrink-0 flex justify-end items-center">
{onBack && (
Expand Down Expand Up @@ -48,14 +64,21 @@ const TopBar: React.FC<TopBarProps> = ({ onBack, hideInfo, purchaseLink }) => {
)}
{!hideInfo && (
<div className="flex items-center pt-2 gap-3">
{purchaseLink && (
<Link
to={purchaseLink}
className="bg-white border border-gray-200 rounded-full px-2.5 py-1 text-[10px] font-semibold text-[#767a83]"
>
이용권 구매
</Link>
)}
{purchaseLinkEl &&
(ENABLE_TIMESALE_TOOLTIP ? (
<Tooltip open>
<TooltipTrigger asChild>{purchaseLinkEl}</TooltipTrigger>
<TooltipContent
side="bottom"
className="bg-rose-500 text-white border-none"
arrowClassName="bg-rose-500 fill-rose-500"
>
타임세일 중!
</TooltipContent>
</Tooltip>
) : (
purchaseLinkEl
))}
<Link to="/my">
<img src={userIcon} alt="User" className="size-9" />
</Link>
Expand Down
12 changes: 10 additions & 2 deletions src/components/ui/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ function TooltipTrigger({

function TooltipContent({
className,
arrowClassName,
sideOffset = 0,
children,
...props
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
}: React.ComponentProps<typeof TooltipPrimitive.Content> & {
arrowClassName?: string;
}) {
return (
<TooltipPrimitive.Portal>
<TooltipPrimitive.Content
Expand All @@ -50,7 +53,12 @@ function TooltipContent({
{...props}
>
{children}
<TooltipPrimitive.Arrow className="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
<TooltipPrimitive.Arrow
className={cn(
"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",
arrowClassName,
)}
/>
</TooltipPrimitive.Content>
</TooltipPrimitive.Portal>
);
Expand Down
2 changes: 2 additions & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export const ENABLE_KAKAO_PAYMENTS: boolean =
import.meta.env.VITE_ENABLE_KAKAO_PAYMENTS === "true";
export const ENABLE_CONNECTION_INFO: boolean =
import.meta.env.VITE_ENABLE_CONNECTION_INFO === "true";
export const ENABLE_TIMESALE_TOOLTIP: boolean =
import.meta.env.VITE_ENABLE_TIMESALE_TOOLTIP === "true";
export const DISABLED_PROFILE_VIEW_DESC: string =
import.meta.env.VITE_DISABLED_PROFILE_VIEW_DESC ??
"5/21(수) 10:00부터 시그널을 보낼 수 있어요.";
Expand Down
Loading