Merge pull request #40 from Leets-Official/refactor/#39 #6
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
name: Yes CI 파이프라인 | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
environment: production | |
permissions: | |
contents: read | |
steps: | |
- name: branch checkout | |
uses: actions/checkout@v4 | |
- name: JDK 21 설정 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Gradle Wrapper 권한 부여 | |
run: chmod +x gradlew | |
- name: Gradle Caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
gradle-${{ runner.os }} | |
- name: Gradle 빌드 | |
run: ./gradlew clean build | |
- name: Docker 이미지 빌드 | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
dockerfile: Dockerfile | |
push: false | |
tags: ${{secrets.DOCKER_USERNAME}}/yes:latest | |
- name: Docker 로그인 | |
uses: docker/login-action@v3 | |
with: | |
username: ${{secrets.DOCKER_USERNAME}} | |
password: ${{secrets.DOCKER_ACCESS_TOKEN}} | |
- name: Docker 이미지 Push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
dockerfile: Dockerfile | |
push: true | |
tags: ${{secrets.DOCKER_USERNAME}}/yes:latest |