-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (101 loc) ยท 3.66 KB
/
gradle.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: from DEVELOP to MAIN
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- 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: ap-northeast-2
## gradle caching
- name: Gradle ์บ์ฑ
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Make application.yml
run: |
cd ./src/main
ls
cd ./resources
touch ./application.yml
touch ./application-dev.yml
echo "$APPLICATION" > ./application.yml
echo "$APPLICATION_DEV" > ./application-dev.yml
env:
APPLICATION: ${{ secrets.APPLICATION }}
APPLICATION_DEV: ${{ secrets.APPLICATION_DEV }}
shell: bash
- name: Gradle ๊ถํ ๋ถ์ฌ
run: |
chmod +x gradlew
- name: Gradle๋ก ๋น๋ ์คํ
run: |
./gradlew bootjar
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
# - name: Build, tag, and push image to Amazon ECR
# id: build-image
# env:
# ECR_REGISTRY: ${{secrets.ECR_REGISTRY}}
# IMAGE_TAG: ${{secrets.IMAGE_TAG}}
# IMAGE_NAME: ${{secrets.IMAGE_NAME}}
# run: |
# docker build --platform=linux/amd64 -t $IMAGE_NAME .
# docker tag $IMAGE_NAME:$IMAGE_TAG $ECR_REGISTRY/$IMAGE_NAME:$IMAGE_TAG
# docker push $ECR_REGISTRY/$IMAGE_NAME:$IMAGE_TAG
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
approval:
needs: build
runs-on: ubuntu-latest
steps:
# - name: Request approval
# uses: hmarr/auto-approve-action@v2
# with:
# github_token: ${{secrets.GIT_TOKEN}}
# reviewers: 'SangWoon123'
- name: Slack ์๋ ๋ฐ์ก
uses: slackapi/[email protected]
if: success()
with:
payload: |
{
"attachments": [
{
"color": "good",
"title": "๋ฐฐํฌ ์ฑ๊ณต",
"text": "๋ฐฐํฌ๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์๋ฃ๋์์ต๋๋ค ์์ธํ ๋ด์ฉ์ ๋ณด๋ ค๋ฉด ์ฌ๊ธฐ๋ฅผ ํด๋ฆญํ์ธ์: ",
"footer": "Github Actions",
"ts": ${Math.floor(Date.now()/1000)}
}
]
}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}