fix : status 조회 잘 되도록 #27
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: PicTalk dev CD # workflow 이름 | |
on: # 이벤트 설정 | |
pull_request: | |
types: [ closed ] | |
workflow_dispatch: # 수동 실행도 가능하도록 설정 | |
jobs: | |
build: # job 이름 | |
runs-on: ubuntu-latest # OS환경 | |
# PR이 merge되었고, 'dev' 브랜치일 경우 수행 | |
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 # 코드 check-out | |
# '.github' 디렉토리가 포함된 디렉토리의 하위 코드들 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4.0.0 # 자바 설치 | |
with: | |
java-version: 17 # 버전 | |
distribution: 'adopt' # 배포판 | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
shell: bash # gradle wrapper 권한 부여 | |
- name: Build with Gradle | |
run: ./gradlew clean build -x test | |
shell: bash # gradle build | |
- name: Get current time | |
uses: 1466587594/get-current-time@v2 # build시점의 시간 확보 | |
id: current-time | |
with: | |
format: YYYY-MM-DDTHH-mm-ss | |
utcOffset: "+09:00" # 서울 UTC 적용 | |
- name: Show Current Time | |
run: echo "CurrentTime=$" # 확보한 시간 보여주기 | |
shell: bash | |
- name: Generate deployment package | |
run: | | |
mkdir -p deploy | |
cp build/libs/*.jar deploy/application.jar | |
cp Procfile deploy/Procfile | |
cp -r .ebextensions deploy/.ebextensions | |
cp -r .platform deploy/.platform | |
cd deploy && zip -r deploy.zip . | |
- name: Beanstalk Deploy | |
uses: einaregilsson/beanstalk-deploy@v20 | |
with: | |
aws_access_key: ${{ secrets.AWS_GITHUB_ACTIONS_ACCESS_KEY_ID }} | |
aws_secret_key: ${{ secrets.AWS_GITHUB_ACTIONS_SECRET_ACCESS_KEY }} | |
application_name: pictalk-dev | |
environment_name: Pictalk-dev-env | |
version_label: github-action-${{ steps.current-time.outputs.formattedTime }} | |
region: ap-northeast-2 | |
deployment_package: deploy/deploy.zip | |
wait_for_deployment: false |