-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (51 loc) · 1.78 KB
/
CICD.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
# 워크플로우의 이름 지정
name: CICD
on:
push:
branches:
- main
- 'feature/#123-feat-cicd'
jobs:
build:
# 실행 환경 지정
runs-on: ubuntu-latest
# 실행 스텝 지정
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Create application.properties
run: |
mkdir -p ./src/main/resources # 디렉토리가 없는 경우 생성
echo "${{ secrets.APPLICATION }}" | cat > ./src/main/resources/application.properties
- name: Upload application.properties
uses: actions/upload-artifact@v3
with:
name: application.properties
path: ./src/main/resources/application.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle (skip tests)
run: ./gradlew clean build -x test
- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"
# 배포용 패키지 경로 저장
- name: Set artifact
run: echo "artifact=\"$(ls ./build/libs/mallangs-*.jar)\"" >> $GITHUB_ENV
# 빈스토크 배포
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }}
application_name: mallangs-web
environment_name: Mallangs-web-env
version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
region: ap-northeast-2
deployment_package: ${{ env.artifact }}