1+ name : wekids-baas Dev CI/CD 
2+ 
3+ on :
4+   pull_request :
5+     types : [closed] 
6+   workflow_dispatch : #  (2).์๋ ์คํ๋ ๊ฐ๋ฅํ๋๋ก
7+ 
8+ jobs :
9+   build :
10+     runs-on : ubuntu-latest  #  (3).OSํ๊ฒฝ
11+     if : github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'test' 
12+ 
13+     steps :
14+       - name : Checkout 
15+         uses : actions/checkout@v3  #  (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 : wekdis-baas-dev 
57+           environment_name : Wekdis-baas-dev-env 
58+           version_label : github-action-${{ steps.current-time.outputs.formattedTime }} 
59+           region : ap-northeast-1 
60+           deployment_package : deploy/deploy.zip 
61+           wait_for_deployment : false 
0 commit comments