From ce304b0ba19a15ec3cf72d35169d7302af3738c3 Mon Sep 17 00:00:00 2001 From: gohyeoncheol Date: Thu, 22 May 2025 09:32:57 +0900 Subject: [PATCH] :sparkles: feat: [KAN-83] Add production ci --- .github/workflows/befly-prod-ci.yml | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/befly-prod-ci.yml diff --git a/.github/workflows/befly-prod-ci.yml b/.github/workflows/befly-prod-ci.yml new file mode 100644 index 0000000..54a22fa --- /dev/null +++ b/.github/workflows/befly-prod-ci.yml @@ -0,0 +1,47 @@ +name: 🚀Befly API Gateway CI + +on: + pull_request: + branches: + - production + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Gateway Repository + uses: actions/checkout@v2 + with: + submodules: true + token: ${{ secrets.PAT }} + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Set up Git authentication for submodules + run: | + git config --global url."https://${{ secrets.PAT }}@github.com".insteadOf "https://github.com" + git submodule update --init --recursive + + - name: Build with Gradle + run: | + chmod +x ./gradlew + ./gradlew clean build -x test + + - name: Get Git short SHA + id: vars + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Log in to Docker Hub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Build Docker Image + run: | + docker build -t ${{ secrets.DOCKER_USERNAME }}/befly-gateway:latest . + + - name: Push to Docker Hub + run: | + docker push ${{ secrets.DOCKER_USERNAME }}/befly-gateway:${{ steps.vars.outputs.sha }} \ No newline at end of file