-
Notifications
You must be signed in to change notification settings - Fork 10
70 lines (57 loc) · 1.95 KB
/
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
65
66
67
68
69
70
name: deploy
on:
push:
branches:
- 'letskuku'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: make application.yml
run: |
cd ./src/main
mkdir resources
touch ./application.yml
echo "${{ secrets.PROPERTIES }}" > ./application.yml
shell: bash
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash
- name: Build with Gradle
run: |
./gradlew -version
./gradlew clean build -x test
shell: bash
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name : Build Docker Image & Push to Docker Hub
run: |
docker build . -t ${{ secrets.DOCKER_HUB_USERNAME }}/spring-daagn-market-18th
docker build ./proxy -t ${{ secrets.DOCKER_HUB_USERNAME }}/nginx
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/spring-daagn-market-18th
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/nginx
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v18
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: spring-daagn-market-18th
environment_name: Spring-daagn-market-18th-env
version_label: deploy-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: ./docker-compose.yml