๋ฐ์ํ
Intro
์๋ ํ์ธ์. ์ด๋ฒ ์๊ฐ์๋ JDK 17์ฉ Github ์ํฌํ๋ก Github workflow ์์ฑ ๋ฐฉ๋ฒ์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค. ์ฐธ๊ณ ๋ก github workflow์ ๋ํด ๊ถ๊ธํ์ ๋ถ ๊ณ์๋ฉด ์ผ์ ์ ์ ๊ฐ ์์ฑํ ํฌ์คํ ๊ธ ([GitHub Actions] GitHub Actions์ด๋? ๊ตฌ์ฑ์์ ๋ฐ Workflows ํ์ผ ์์ ์ดํด๋ณด๊ธฐ) ์ฐธ๊ณ ๋ถํ๋๋ฆฝ๋๋ค.
How to do
SpringBoot + Java Version 17 + Gradle ๊ธฐ์ค ์์ฑ๋ฒ์ ์๋์ ๊ฐ์ต๋๋ค.
# This is a basic workflow to help you get started with Actions
name: api-server
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- dev
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
#env:
# PROJECT_NAME: api-server
# S3_BUCKET_NAME: api-server
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt' # See 'Supported distributions' for available options
- name: (Release) Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y/%m/%d')"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
shell: bash
- name: Build with Gradle
run: |
./gradlew —version
./gradlew :api:build -x test
shell: bash
JDK 17 ๋ฒ์ ์ ์ฌ์ฉํด์ผ ํ๋ฏ๋ก ์๋์ ๊ฐ์ด java-version: 17์ ๋ช ์ํด์ค์ผ ํฉ๋๋ค.
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt' # See 'Supported distributions' for available options
๋ฐ์ํ