[fix] 날짜 계산 로직 변경 #223
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy CI/CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20.17.0' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build application | |
| env: | |
| NODE_ENV: production | |
| NEXT_TELEMETRY_DISABLED: 1 | |
| run: npm run build | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: .env setting | |
| run: | | |
| echo "NEXT_PUBLIC_API_URL"=${{ secrets.NEXT_PUBLIC_API_URL }} >> .env | |
| echo "NAVER_MAP_CLIENT_ID"=${{ secrets.NAVER_MAP_CLIENT_ID }} >> .env | |
| echo "NAVER_MAP_CLIENT_SECRET"=${{ secrets.NAVER_MAP_CLIENT_SECRET }} >> .env | |
| - name: Build Docker image And Push | |
| run: docker buildx build -t ${{ secrets.DOCKERHUB_USERNAME }}/codin-frontend:latest --push . | |
| - name: Deploy to Server | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| password: ${{secrets.PASSWORD}} | |
| port: ${{secrets.PORT}} | |
| script: | | |
| echo ${{ secrets.PASSWORD }} | sudo -S su -c " | |
| docker ps -a | |
| docker rm -f codin-frontend || true | |
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/codin-frontend:latest | |
| docker run -d --net codin-docker_default -p 3000:3000 --name codin-frontend ${{ secrets.DOCKERHUB_USERNAME }}/codin-frontend:latest | |
| docker images -f "dangling=true" -q | xargs sudo docker rmi || true | |
| docker ps -a | |
| " |