diff --git a/.github/workflows/CD-MAIN.yml b/.github/workflows/CD-MAIN.yml index 2ac7439..8e7d092 100644 --- a/.github/workflows/CD-MAIN.yml +++ b/.github/workflows/CD-MAIN.yml @@ -12,8 +12,6 @@ jobs: runs-on: ubuntu-22.04 env: working-directory: neighbor - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_LOGIN_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_LOGIN_ACCESSTOKEN }} steps: - name: 체크아웃 @@ -72,7 +70,7 @@ jobs: host: ${{ secrets.RELEASE_SERVER_IP }} username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.RELEASE_SERVER_KEY }} - script: | - docker rm -f neighbor-8080 - docker image pull sss4920/neighbor - docker run -d --name neighbor-8080 -p 8080:8080 sss4920/neighbor + run: | + cd ~ + chmod +x deploy.sh + ./deploy.sh diff --git a/neighbor/src/main/java/com/likelion/neighbor/global/cache/ShortUrlRedisRepository.java b/neighbor/src/main/java/com/likelion/neighbor/global/cache/ShortUrlRedisRepository.java new file mode 100644 index 0000000..7d9035e --- /dev/null +++ b/neighbor/src/main/java/com/likelion/neighbor/global/cache/ShortUrlRedisRepository.java @@ -0,0 +1,8 @@ +package com.likelion.neighbor.global.cache; + +import org.springframework.data.repository.CrudRepository; + +import com.likelion.neighbor.global.dto.ShortUrlReponseDto; + +public interface ShortUrlRedisRepository extends CrudRepository { +} diff --git a/neighbor/src/main/java/com/likelion/neighbor/global/config/RedisCacheConfig.java b/neighbor/src/main/java/com/likelion/neighbor/global/config/RedisCacheConfig.java new file mode 100644 index 0000000..93eb47b --- /dev/null +++ b/neighbor/src/main/java/com/likelion/neighbor/global/config/RedisCacheConfig.java @@ -0,0 +1,23 @@ +package com.likelion.neighbor.global.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; + +@Configuration +public class RedisCacheConfig { + + @Value("${spring.data.redis.host") + private String host; + + @Value("${spring.data.redis.port") + private int port; + + @Bean + public RedisConnectionFactory redisConnectionFactory(){return new LettuceConnectionFactory(host,port); + } + +} diff --git a/neighbor/src/main/java/com/likelion/neighbor/global/dto/ShortUrlReponseDto.java b/neighbor/src/main/java/com/likelion/neighbor/global/dto/ShortUrlReponseDto.java new file mode 100644 index 0000000..a56e3ca --- /dev/null +++ b/neighbor/src/main/java/com/likelion/neighbor/global/dto/ShortUrlReponseDto.java @@ -0,0 +1,4 @@ +package com.likelion.neighbor.global.dto; + +public class ShortUrlReponseDto { +}