Merge pull request #30 from KONKUK-MAP-Service/feat-spot #23
This file contains 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
# workflow의 이름 | |
name: CI | |
# 해당 workflow가 언제 실행될 것인지에 대한 트리거를 지정 | |
on: | |
push: | |
branches: | |
- main # main branch로 push 될 때 실행됩니다. | |
- cicd # cicd branch로 push 될 때도 실행됩니다. | |
pull_request: | |
branches: | |
- main # main branch로 pull request될 때 실행됩니다. | |
- cicd # cicd branch로 pull request될 때도 실행됩니다. | |
#. | |
jobs: | |
build: | |
name: CI | |
runs-on: ubuntu-latest | |
steps: | |
# 작업에서 액세스할 수 있도록 $GITHUB_WORKSPACE에서 저장소를 체크아웃. | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
#githubsecrets yml 환경변수 주입. | |
- name: Set Yaml | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: ./src/main/resources/application.yml | |
env: | |
spring.datasource.url: ${{ secrets.DB_URL }} | |
spring.datasource.username: ${{ secrets.DB_USERNAME }} | |
spring.datasource.password: ${{ secrets.DB_PASSWORD }} | |
spring.datasource.driver-class-name: ${{ secrets.DB_DRIVER }} | |
spring.jwt.secret: ${{ secrets.JWT_SECRET }} | |
spring.data.redis.host: ${{secrets.REDIS_HOST}} | |
spring.data.redis.port: ${{secrets.REDIS_PORT}} | |
spring.data.redis.password: ${{secrets.REDIS_PASSWORD}} | |
spring.mail.username: ${{secrets.MAIL_USERNAME}} | |
spring.mail.password: ${{secrets.MAIL_PASSWORD}} | |
cloud.aws.credentials.accessKey: ${{secrets.S3_ACCESSKEY}} | |
cloud.aws.credentials.secretKey: ${{secrets.S3_SECRETKEY}} | |
cloud.aws.s3.bucketName: ${{secrets.S3_BUCKETNAME}} | |
#gradlew 실행을 위한 권한 추가 | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
shell: bash | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
shell: bash |