From 35e21c725b85aaf8b29f8fc193b75a949aef2439 Mon Sep 17 00:00:00 2001 From: SeongWonYoon Date: Mon, 2 Dec 2024 17:29:17 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Github=20Action=20gradle.yml=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gradle.yml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..2aa010f --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,50 @@ +name: Deploy + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + # 기본 체크아웃 + - name: Checkout + uses: actions/checkout@v3 + + # Gradlew 실행 허용 + - name: Run chmod to make gradlew executable + run: chmod +x ./gradlew + + # JDK 17 세팅 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + # 환경 변수 설정 + - name: Set environment values + run: | + cd ./src/main/resources + touch ./env.properties + echo "SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }}" >> ./env.properties + echo "SPRING_DATASOURCE_USERNAME=${{ secrets.SPRING_DATASOURCE_USERNAME }}" >> ./env.properties + echo "SPRING_DATASOURCE_PASSWORD=${{ secrets.SPRING_DATASOURCE_PASSWORD }}" >> ./env.properties + echo "JWT_KEY=${{ secrets.JWT_KEY }}" >> ./env.properties + echo "JWT.EXPIRATION.HOURS=${{ secrets.JWT_EXPIRATION_HOURS }}" >> ./env.properties + echo "JWT.ISSUER=${{ secrets.JWT_ISSUER }}" >> ./env.properties + shell: bash + + # Gradle build (Test 제외) + - name: Build with Gradle + uses: gradle/gradle-build-action@v3 + with: + arguments: clean build -x test