✨ [feature] 카카오 로그인 구현 #22
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: Docker Image CI/CD | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x ./gradlew | |
| - name: Create file upload directory | |
| run: mkdir -p tmp/file/userVoice | |
| # 테스트를 건너뛰고 빌드만 실행 | |
| - name: Build with Gradle (skip tests) | |
| run: ./gradlew build -x test | |
| env: | |
| FILE_UPLOAD_DIR: /tmp/file/temp | |
| API_KEY: ${{ secrets.ChatGptAPI }} | |
| - name: Login to Docker Hub | |
| 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: Get version | |
| id: get_version | |
| run: echo "VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_ENV | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| ${{ secrets.DOCKERHUB_USERNAME }}/sayup:latest | |
| ${{ secrets.DOCKERHUB_USERNAME }}/sayup:${{ github.sha }} | |
| ${{ secrets.DOCKERHUB_USERNAME }}/sayup:${{ env.VERSION }} | |
| cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/sayup:buildcache | |
| cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/sayup:buildcache,mode=max | |
| build-args: | | |
| DB_CONNECTION=mysql | |
| DB_NAME=sayup_db | |
| DB_USERNAME=root | |
| FILE_UPLOAD_DIR=tmp/file/userVoice | |
| DB_PASSWORD=${{ secrets.DB_PASSWORD }} | |
| API_KEY=${{ secrets.ChatGptAPI }} |