test(be): 멀티 스레드 개수 증가 #33
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: BACKEND-CHAT-SERVER-TEST-CICD | |
| on: | |
| push: | |
| branches: | |
| - be-test/chat | |
| paths: | |
| - 'src/backend/**' | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| service: | |
| - chat_server | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Verify repository structure | |
| run: | | |
| echo "Checking main directory..." | |
| ls -la | |
| echo "Checking src/backend/ directory..." | |
| ls -la src/backend/ | |
| - name: Verify working directory | |
| run: ls -la src/backend/${{ matrix.service }} | |
| - name: Set up JDK 17 (Zulu) | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Build Gradle project | |
| working-directory: src/backend/${{ matrix.service }} | |
| run: | | |
| chmod +x gradlew | |
| ./gradlew clean build -x test | |
| - name: Verify JAR file existence | |
| working-directory: src/backend/${{ matrix.service }} | |
| run: ls -la build/libs/ | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build and push Docker image | |
| working-directory: src/backend/${{ matrix.service }} | |
| run: | | |
| docker build --platform linux/amd64 \ | |
| --build-arg JAR_FILE=build/libs/${{ matrix.service }}-0.0.1-SNAPSHOT.jar \ | |
| -t ${{ secrets.DOCKER_USERNAME }}/${{ matrix.service }}:latest . | |
| docker push ${{ secrets.DOCKER_USERNAME }}/${{ matrix.service }}:latest | |
| cd: | |
| needs: build-and-deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Debug Secrets | |
| run: | | |
| echo "SERVER_IP=52.79.186.238" | |
| echo "SERVER_USER=ubuntu" | |
| echo "SERVER_KEY Length=$(echo -n "${{ secrets.CHAT_SERVER_SECRET_KEY }}" | wc -c)" | |
| - name: Deploy to server | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: 52.79.186.238 | |
| username: ubuntu | |
| key: ${{ secrets.CHAT_SERVER_SECRET_KEY }} | |
| script: | | |
| cd ~ | |
| ./deploy.sh |