HOTFIX: Redis 장애조치 복구 #8
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: prod-CI | |
on: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
branches: [ "main" ] | |
jobs: | |
prod-ci: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout - 가상 머신에 체크아웃 | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# JDK setting - JDK 17 설정 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
# gradle caching - 빌드 시간 향상 | |
- name: Gradle Caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
# gradle build - 테스트 없이 gradle 빌드 | |
- name: Build with Gradle | |
run: | | |
chmod +x gradlew | |
./gradlew build -x test | |
shell: bash | |
# Set up Docker Buildx - Docker Buildx 설치 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
# Log in to Docker Hub - Docker Hub 로그인 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.PROD_DOCKER_USERNAME }} | |
password: ${{ secrets.PROD_DOCKER_ACCESS_TOKEN }} | |
# Build and push Docker image - Docker image 빌드 및 푸시 | |
- name: Build and push Docker image | |
run: | | |
docker build --platform linux/amd64 -t ${{ secrets.PROD_DOCKER_USERNAME }}/lupg . | |
docker push ${{ secrets.PROD_DOCKER_USERNAME }}/lupg |