-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.89 KB
/
dev_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Reborn dev CI/CD
on:
pull_request:
types:
- closed
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop'
steps:
- name: Checkout
uses: actions/checkout@v4
- 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
- name: Build with Gradle
run: ./gradlew clean build -x test
shell: bash #build 시작
- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: 'YYYY-MM-DDTHH:mm:ss'
utcOffset: '+09:00' #build 시점의 시간 확보
- name: Show current time
run: echo "${{ steps.current-time.outputs.formattedTime }}"
shell: bash
- name: Generate deployment package #빌드 ing
run: |
mkdir -p deploy
cp build/libs/*.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 .
#beanstalk에게 배포 요청
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY_ID }} #github에 등록 완료
aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }}
application_name: 'Reborn-dev'
environment_name: 'Reborn-dev-env'
version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
region: 'ap-northeast-2'
deployment_package: 'deploy/deploy.zip'
wait_for_deployment: false