Skip to content

Commit 8164318

Browse files
authored
Merge pull request #3 from 9ITHON/ci/1
ci/cd 파일 수정
2 parents c642bff + f5933ef commit 8164318

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

.github/workflows/dev_deploy.yml

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,55 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest # (3).OS환경
11-
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev'
11+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev'
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2 # (4).코드 check out
16+
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: 17 # (5).자바 설치
21+
distribution: 'adopt'
22+
23+
- name: Grant execute permission for gradlew
24+
run: chmod +x ./gradlew
25+
shell: bash # (6).권한 부여
26+
27+
- name: Build with Gradle
28+
run: ./gradlew clean build -x test
29+
shell: bash # (7).build시작
30+
31+
- name: Get current time
32+
uses: 1466587594/get-current-time@v2
33+
id: current-time
34+
with:
35+
format: YYYY-MM-DDTHH-mm-ss
36+
utcOffset: "+09:00" # (8).build시점의 시간확보
37+
38+
- name: Show Current Time
39+
run: echo "CurrentTime=$"
40+
shell: bash # (9).확보한 시간 보여주기
41+
42+
- name: Generate deployment package
43+
run: |
44+
mkdir -p deploy
45+
cp build/libs/*.jar deploy/application.jar
46+
cp Procfile deploy/Procfile
47+
cp -r .ebextensions_dev deploy/.ebextensions
48+
cp -r .platform deploy/.platform
49+
cd deploy && zip -r deploy.zip .
50+
51+
- name: Beanstalk Deploy
52+
uses: einaregilsson/beanstalk-deploy@v20
53+
with:
54+
aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY_ID }}
55+
aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }}
56+
application_name: spring1-dev
57+
environment_name: workbook2-dev-env
58+
version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
59+
region: ap-northeast-2
60+
deployment_package: deploy/deploy.zip
61+
wait_for_deployment: false
62+

0 commit comments

Comments
 (0)