refactor: 엑셀 값 수정 #41
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: deploy CI/CD on branch 'main' | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| # Ticketing API Module CI | |
| build-api-module: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Build API module | |
| run: ./gradlew build -x test | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: docker.io | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build & Push API image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/codin-ticketing-api:latest | |
| # Ticketing SSE Module CI | |
| build-sse-module: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Build SSE module | |
| working-directory: codin-ticketing-sse | |
| run: ./gradlew build -x test | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: docker.io | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build & Push SSE image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: codin-ticketing-sse | |
| push: true | |
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/codin-ticketing-sse:latest | |
| # Ticketing (API + SSE) CD | |
| deploy: | |
| needs: [build-api-module, build-sse-module] | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Deploy to server via SSH | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }} | |
| port: ${{ secrets.PORT }} | |
| script: | | |
| echo ${{ secrets.PASSWORD }} | sudo -S su -c " | |
| docker ps -a | |
| cd /opt/project/codin-ticketing | |
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/codin-ticketing-api:latest | |
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/codin-ticketing-sse:latest | |
| docker rm -f codin-ticketing-api || true | |
| docker rm -f codin-ticketing-sse || true | |
| docker compose -f ticketing-docker-compose.yml up -d | |
| docker images -f "dangling=true" -q | xargs sudo docker rmi || true | |
| docker ps -a | |
| " |