Spring Boot(Maven) + Git hub action CI 해보기

2022. 10. 28. 09:49Git

1. Git hub Actions 탭 들어가기

2. New workflow 클릭

 

3. Java with Maven Configure 클릭

4. https://docs.github.com/en/actions/publishing-packages/publishing-docker-images

해당 구문들 추가하기

 

Publishing Docker images - GitHub Docs

Introduction This guide shows you how to create a workflow that performs a Docker build, and then publishes Docker images to Docker Hub or GitHub Packages. With a single workflow, you can publish images to a single registry or to multiple registries. Prere

docs.github.com

 

5. pom.xml 에 플러그인 추가

6. Git Setting 들어가기

7. Secrets - Actions 들어가기

8. New repository secret 클릭하기

9. 도커 허브 로그인을 위해 아이디 패스워드 각각 만들어주기

=> 4.에서 도커 허브에 로그인 하는 상수명을 맞추어주어야 한다.

10. 이제 깃에 올리면 빌드 이후 도커 이미지를 만들어서 도커 허브에 띄울 수 있다.