Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP #2

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
44 changes: 23 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,51 @@ jobs:
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout 🏁
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
node-version: 16

- name: Check current directory
run: |
echo "Current directory:"
pwd
echo "Directory content:"
ls -la

- name: Change to project dic
run: cd /home/runner/work/Peer-Frontend/Peer-Frontend
run: cd /home/runner/work/FE_CICD/FE_CICD

- name: Install packages
run: npm i /home/runner/work/Peer-Frontend/Peer-Frontend
run: npm i /home/runner/work/FE_CICD/FE_CICD

- name: Prettier
working-directory: /home/runner/work/Peer-Frontend/Peer-Frontend
working-directory: /home/runner/work/FE_CICD/FE_CICD
run: npm run format

- name: Lint
working-directory: /home/runner/work/Peer-Frontend/Peer-Frontend
working-directory: /home/runner/work/FE_CICD/FE_CICD
run: npm run lint

CD:
name: Deployment
runs-on: ubuntu-latest
needs: CI
steps:
- name: Checkout 🏁
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Build and push Docker image
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -f Dockerfile-dev -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_DEV_IMAGE }} .
touch /home/runner/work/FE_CICD/FE_CICD/.env.production
echo "${{ secrets.ENV_FILE }}" >> /home/runner/work/FE_CICD/FE_CICD/.env.production
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_DEV_IMAGE }} .
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_DEV_IMAGE }}

- name: Deploy
Expand All @@ -66,6 +68,6 @@ jobs:
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_DEV_IMAGE }}
docker rm -f $(docker ps -qa)
docker run -d -p 80:8080 ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_DEV_IMAGE }}
docker run -d -p 80:3000 ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_DEV_IMAGE }}
docker container prune -f
docker image prune -f
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:16-alpine
WORKDIR ./src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
RUN npm run build
CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion src/components/CuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface CuButtonProps {
startIcon?: React.JSX.Element // 버튼 텍스트 앞에 들어갈 아이콘
endIcon?: React.JSX.Element // 버튼 텍스트 뒤에 들어갈 아이콘
fullWidth?: boolean // width: 100%
disabled?: boolean
disabled?: boolean // 버튼 비활성화
}

const CuButton = ({
Expand Down
Loading