feat: 유저 행동 분석을 위한 event record endpoint 추가 #85
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
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | |
| name: Java CD with Gradle | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Gradle Caching | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Copy secrets | |
| env: | |
| BOLETTO_SECRET: ${{ secrets.BOLETTO_SECRET }} | |
| BOLETTO_FIREBASE_SECRET: ${{ secrets.BOLETTO_FIREBASE_SECRET }} | |
| BOLETTO_OCI_SECRET: ${{ secrets.BOLETTO_OCI_SECRET }} | |
| BOLETTO_SECRET_DIR: src/main/resources | |
| BOLETTO_SECRET_DIR_FILE_NAME: application-secret.yml | |
| BOLETTO_FIREBASE_SECRET_FILE_NAME: firebase-adminsdk.json | |
| BOLETTO_OCI_SECRET_FILE_NAME: oci-private-key.pem | |
| BOLETTO_APPLE_SECRET_FILE_PATH: ${{ secrets.BOLETTO_APPLE_SECRET_FILE_PATH }} | |
| BOLETTO_APPLE_SECRET_FILE: ${{ secrets.BOLETTO_APPLE_SECRET_FILE }} | |
| run: | | |
| echo $BOLETTO_SECRET | base64 --decode > $BOLETTO_SECRET_DIR/$BOLETTO_SECRET_DIR_FILE_NAME | |
| echo $BOLETTO_FIREBASE_SECRET | base64 --decode > $BOLETTO_SECRET_DIR/$BOLETTO_FIREBASE_SECRET_FILE_NAME | |
| echo $BOLETTO_OCI_SECRET | base64 --decode > $BOLETTO_SECRET_DIR/$BOLETTO_OCI_SECRET_FILE_NAME | |
| echo $BOLETTO_APPLE_SECRET_FILE | base64 --decode > $BOLETTO_SECRET_DIR/$BOLETTO_APPLE_SECRET_FILE_PATH | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle Wrapper | |
| run: ./gradlew bootJar | |
| - name: Setup docker buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker login | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Docker build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/deploy:boletto_server | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Execute remote ssh | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.BOLETTO_HOST }} | |
| username: ${{ secrets.BOLETTO_USERNAME }} | |
| key: ${{ secrets.BOLETTO_KEY }} | |
| port: ${{ secrets.BOLETTO_PORT }} | |
| script: | | |
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/deploy:boletto_server | |
| docker stop boletto | |
| docker rm boletto | |
| docker run -d --name boletto -p 8080:8080 -v /home/ubuntu/secret/wallet:/secret/wallet ${{ secrets.DOCKERHUB_USERNAME }}/deploy:boletto_server | |