Skip to content

Commit

Permalink
Merge pull request #5 from chhw130/dev
Browse files Browse the repository at this point in the history
PR : add env file
  • Loading branch information
chhw130 authored Dec 12, 2023
2 parents 79cea6d + e922d9c commit 787b534
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 11 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Simple workflow for deploying static content to GitHub Pages
name: build fe-docker image

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
build-and-push:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup docker build
uses: docker/setup-buildx-action@v2

- name: set npnm
uses: pnpm/action-setup@v2

- name: set Node.js
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: '.'

- name: Login to Container Registry
uses: docker/[email protected]
with:
registry: harbor.example.com
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}

- name: Build and push to Container Registry
uses: docker/[email protected]
with:
context: .
push: true
pull: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
APP_ENV=${{ inputs.environment }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
2 changes: 2 additions & 0 deletions component/Funnel/MainFunnel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface MainFunnelPropsType {
}

const MainFunnel = ({ setFunnel }: MainFunnelPropsType) => {
console.log(process.env.NEXT_PUBLIC_API_URL);

return (
<>
<Image
Expand Down
7 changes: 1 addition & 6 deletions component/form/UserInfoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,9 @@ function RadioCard(props: any) {
interface UserInfoFormPropsType {
setFunnel: React.Dispatch<React.SetStateAction<string>>;
setProgress: React.Dispatch<React.SetStateAction<number>>;
setUserInfo: React.Dispatch<React.SetStateAction<UserInfoType>>;
}

const UserInfoForm = ({
setFunnel,
setProgress,
setUserInfo,
}: UserInfoFormPropsType) => {
const UserInfoForm = ({ setFunnel, setProgress }: UserInfoFormPropsType) => {
const options = ["남성", "여성"];

const { getRootProps, getRadioProps, value } = useRadioGroup({
Expand Down
25 changes: 25 additions & 0 deletions environment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
NEXT_PUBLIC_API_URL: string;
NEXT_PUBLIC_SERVICE_ID: string;
NEXT_PUBLIC_ACCESS_KEY: string;
NEXT_PUBLIC_SECRET_KEY: string;
NEXT_PUBLIC_GITHUB_ID: string;
NEXT_PUBLIC_GITHUB_SECRET: string;
NEXT_PUBLIC_KAKAO_ID: string;
NEXT_PUBLIC_KAKAO_SECRET: string;
NEXT_PUBLIC_NAVER_ID: string;
NEXT_PUBLIC_NAVER_SECRET: string;
NEXT_PUBLIC_BASE_URL: string;
NEXT_PUBLIC_DEV_BASE_URL: string;
NEXT_PUBLIC_DEPLOY_BASE_URL: string;

NODE_ENV: "development" | "production";
}
}
}

declare module "*.png";

export {};
2 changes: 2 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import LoginFunnel from "../../component/Funnel/LoginFunnel";

export default function Home() {
const { funnel, setFunnel } = useFunnel("main");

console.log(process.env.NEXT_PUBLIC_API_URL);
return (
<Flex
as={"main"}
Expand Down
6 changes: 1 addition & 5 deletions src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ const Page = () => {
<UserAgreementForm setFunnel={setFunnel} setProgress={setProgress} />
)}
{funnel === "userInfo" && (
<UserInfoForm
setFunnel={setFunnel}
setProgress={setProgress}
setUserInfo={setUserInfo}
/>
<UserInfoForm setFunnel={setFunnel} setProgress={setProgress} />
)}
{funnel === "userPhysics" && <UserPhysicForm />}
</Flex>
Expand Down

0 comments on commit 787b534

Please sign in to comment.