Skip to content

자세한 에러 로그 확인 (#37) #54

자세한 에러 로그 확인 (#37)

자세한 에러 로그 확인 (#37) #54

Workflow file for this run

name: climbing
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
# CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Pull Redis Docker image
run: docker pull redis
- name: Run Redis container
run: docker run --name my-redis -d -p 6379:6379 redis
- name: Set AwsS3 Key at yaml
uses: microsoft/variable-substitution@v1
with:
files: ./src/main/resources/application-ci.yml, ./src/main/resources/application-prod.yml
env:
aws.s3.bucket: ${{ secrets.AWS_S3_BUCKET }}
aws.s3.accessKey: ${{ secrets.AWS_S3_ACCESS_KEY }}
aws.s3.secretKey: ${{ secrets.AWS_S3_SECRET_KEY }}
- name: Grant execute permission to gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew test -i
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time # 현재 시간(+9)이 id에 담김
with:
format: YYYY-MM-DDTHH-mm-ss
utfOffset: "+09:00"
- name: Generate deployment package
run: zip -r deploy.zip .
# EB에 배포
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }}
application_name: climbing-api
environment_name: Climbing-api-env
version_label: climbing-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: deploy.zip