Skip to content

Commit

Permalink
Merge pull request #103 from 2024-startup/BE/feat/#96
Browse files Browse the repository at this point in the history
[BE/feat/#96] CI 첫 구현
  • Loading branch information
kalsteve authored May 26, 2024
2 parents cdca85b + 303bd83 commit 1f72aa3
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 20 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/backendCI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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: Backend CI

on:
push:
branches: [ "dev" ]
paths:
- 'backend/**'
pull_request:
branches: [ "dev" ]
paths:
- 'backend/**'

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: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
with:
gradle-version: '8.5'

- name: Build with Gradle Wrapper
env:
SPRING_DATASOURCE_URL: ${{ secrets.SPRING_DATASOURCE_URL }}
SPRING_DATASOURCE_PASSWORD: ${{ secrets.SPRING_DATASOURCE_PASSWORD }}
SPRING_DATASOURCE_USERNAME: ${{ secrets.SPRING_DATASOURCE_USERNAME }}
SPRING_DATASOURCE_DRIVER_CLASS_NAME: ${{ secrets.SPRING_DATASOURCE_DRIVER_CLASS_NAME }}
SPRING_JPA_DATABASE: ${{ secrets.SPRING_JPA_DATABASE }}
S3_BUCKET_URL: ${{ secrets.S3_BUCKET_URL }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
run: ./gradlew build

dependency-submission:

runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
40 changes: 20 additions & 20 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
name: Deploy Spring Boot App

# 워크플로우가 시작될 조건 설정
on:
push:
branches:
- dev # 배포할 브랜치 설정

jobs:
deploy:
runs-on: ubuntu-latest # 실행 환경 설정

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'

- name: Build with Gradle
run: ./gradlew build -x test # 테스트 제외하고 빌드
#on:
# push:
# branches:
# - dev # 배포할 브랜치 설정
#
#jobs:
# deploy:
# runs-on: ubuntu-latest # 실행 환경 설정
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v2
#
# - name: Set up JDK 17
# uses: actions/setup-java@v2
# with:
# java-version: '17'
#
# - name: Build with Gradle
# run: ./gradlew build -x test # 테스트 제외하고 빌드

# - name: Build Docker Image
# run: |
Expand Down

0 comments on commit 1f72aa3

Please sign in to comment.