Repository navigation
[feature/#86] k6 부하테스트 스크립트 작성 (#87) #36
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: CD pipeline (build & push image) | |
| # develop에 머지되면 최신 이미지를 Docker Hub에 push 한다. | |
| # 서버 배포는 Terraform(user-data가 :latest 를 pull)이 담당하므로 여기서는 하지 않는다. | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Grant permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build JAR | |
| run: | | |
| ./gradlew clean | |
| ./gradlew bootJar | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build Docker image (:latest) | |
| run: docker build -t ${{ secrets.DOCKER_USERNAME }}/docker-springboot:latest . | |
| - name: Push to Docker Hub | |
| run: docker push ${{ secrets.DOCKER_USERNAME }}/docker-springboot:latest |