Skip to content

Fix: 자동임시저장할 때 서로 다른 메모가 생성되어 임시저장되는 문제 해결 #55

Fix: 자동임시저장할 때 서로 다른 메모가 생성되어 임시저장되는 문제 해결

Fix: 자동임시저장할 때 서로 다른 메모가 생성되어 임시저장되는 문제 해결 #55

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Next CI/CD in Develop branch
on:
push:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add env
run: echo "${{ secrets.NEXT_LOCAL_ENV }}" > ./.env.local
- name: Docker build
run: DOCKER_BUILDKIT=1 docker build -t ${{ secrets.DOCKER_REPO }}/${{ secrets.DOCKER_IMAGE }} .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker push
run: docker push ${{ secrets.DOCKER_REPO }}/${{ secrets.DOCKER_IMAGE }}
- name: Deploy to dev
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY }}
script: |
ssh next sudo docker rm -f $(ssh next sudo docker ps -qa)
ssh next sudo docker pull ${{ secrets.DOCKER_REPO }}/${{ secrets.DOCKER_IMAGE }}
ssh next sudo docker run -dp 3000:3000 ${{ secrets.DOCKER_REPO }}/${{ secrets.DOCKER_IMAGE }}