Skip to content

[hotfix/#49] redis key & ttl연장 충돌문제 해결 #73

[hotfix/#49] redis key & ttl연장 충돌문제 해결

[hotfix/#49] redis key & ttl연장 충돌문제 해결 #73

Workflow file for this run

name: CI Pipeline
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Give execute permission to gradlew
run: chmod +x ./gradlew
# Secrets로 application.yml 생성
- name: Create application.yml from Secrets
run: |
mkdir -p src/main/resources
cat <<'EOF' > src/main/resources/application.yml
${{ secrets.APPLICATION_YML }}
EOF
# .env 파일을 Secrets에서 통째로 생성
- name: Create .env file from Secrets
run: |
cat <<'EOF' > .env
${{ secrets.ENV }}
EOF
# docker-compose.yml 파일을 Secrets에서 통째로 생성
- name: Create docker-compose.yml file from Secrets
run: |
cat <<'EOF' > docker-compose.yml
${{ secrets.DOCKER_COMPOSE_YML }}
EOF
- name: Build with Gradle
run: ./gradlew build -x test
# PR이 아니고, main/develop 브랜치에 push된 경우에만 Docker 빌드 & 푸시
- name: Build & Push Docker image
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/main'))
run: |
IMAGE_NAME=${{ secrets.DOCKER_USER_NAME }}/firstsori-dev
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USER_NAME }}" --password-stdin
docker build -t $IMAGE_NAME:latest -f ./Dockerfile .
docker push $IMAGE_NAME:latest