Issue/123 sound note #71
Workflow file for this run
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: SP CI/CD | |
on: | |
pull_request: | |
branches: | |
- develop | |
types: | |
- closed | |
workflow_dispatch: # (2).수동 실행도 가능하도록 | |
env: # 새로 추가한 부분 | |
S3_BUCKET_NAME: ssu-plector-deploy | |
PROJECT_NAME: ssu-plector | |
jobs: | |
build: | |
runs-on: ubuntu-latest # (3).OS환경 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 # (4).코드 check out | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 # (5).자바 설치 | |
distribution: 'adopt' | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
shell: bash # (6).권한 부여 | |
- name: Build with Gradle | |
run: ./gradlew clean build -x test | |
shell: bash # (7).build 시작 | |
- name: Make zip file | |
run: zip -r ./$GITHUB_SHA.zip . | |
shell: bash | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Upload to S3 | |
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$PROJECT_NAME/$GITHUB_SHA.zip | |
- name: Generate deployment package | |
run: | | |
mkdir -p deploy | |
cp build/libs/*SNAPSHOT.jar deploy/application.jar | |
cp Procfile deploy/Procfile | |
cp -r .ebextensions-dev deploy/.ebextensions | |
cp -r .platform deploy/.platform | |
cd deploy && zip -r deploy.zip . | |
- name: Get current time # 한국 시간으로 설정 | |
uses: 1466587594/get-current-time@v2 | |
id: current-time | |
with: | |
format: YYYY-MM-DDTHH-mm-ss | |
utcOffset: "+09:00" | |
- name: Beanstalk Deploy | |
uses: einaregilsson/beanstalk-deploy@v21 | |
with: | |
aws_access_key: ${{ secrets.AWS_DEV_ACTION_ACCESS_KEY_ID }} | |
aws_secret_key: ${{ secrets.AWS_DEV_ACTION_SECRET_ACCESS_KEY }} | |
application_name: SP | |
environment_name: SP-env | |
version_label: github-action-${{ steps.current-time.outputs.formattedTime }} | |
region: ap-northeast-2 | |
deployment_package: deploy/deploy.zip | |
wait_for_deployment: false |