feat: 포토가이드 생성 api - 토큰 검증 로직 추가 #46
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: cicd | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew # gradle wrapper를 실행할 수 있도록 권한 부여 | |
shell: bash | |
- name: Build with Gradle | |
run: ./gradlew clean build # 프로젝트 빌드 | |
shell: bash | |
- name: Get current time | |
uses: 1466587594/get-current-time@v2 # 빌드 완료 시간 가져오기 | |
id: current-time | |
with: | |
format: YYYY-MM-DDTHH-mm-ss | |
utcOffset: "+09:00" | |
- name: Show Current Time | |
run: echo "CurrentTime=${{steps.current-time.outputs.formattedTime}}" # 빌드 완료 시간 출력하기 | |
shell: bash | |
# gradle build를 통해 만들어진 jar 파일 beanstalk에 배포하기 위한 zip 파일로 만듬 | |
- name: Generate deployment package | |
run: | | |
mkdir -p deploy | |
cp build/libs/*.jar deploy/application.jar | |
cp Procfile deploy/Procfile | |
cp -r .ebextensions deploy/.ebextensions | |
cd deploy && zip -r deploy.zip . | |
# Beanstalk Deploy 플러그인 사용 | |
- name: Deploy to EB | |
uses: einaregilsson/beanstalk-deploy@v19 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID_EB }} # github secrets로 등록한 값 사용 | |
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_EB }} # github secrets로 등록한 값 사용 | |
application_name: phododo # EB application 이름 | |
environment_name: Phododo-env # EB environment 이름 | |
version_label: github-action-${{steps.current-time.outputs.formattedTime}} | |
region: ap-northeast-2 | |
deployment_package: deploy/deploy.zip | |
wait_for_deployment: false |