-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (39 loc) · 1.41 KB
/
develop-ci.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
name: Java CICD with Gradle
on:
pull_request:
branches:
- 'develop'
push:
branches:
- 'develop'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Create application.yml
run: |
touch ./src/main/resources/application.yml
echo "${{ secrets.APPLICATION_YML }}" >> ./src/main/resources/application.yml
- name: Create application-dev.yml
run: |
touch ./src/main/resources/application-dev.yml
echo "${{ secrets.APPLICATION_DEV_YML }}" >> ./src/main/resources/application-dev.yml
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Login Dockerhub
env:
DOCKER_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKERHUB_TOKEN}}
run: docker login -u ${{secrets.DOCKERHUB_USERNAME}} -p ${{secrets.DOCKERHUB_TOKEN}}
- name: Build the Docker image
run: docker build --platform linux/amd64 --build-arg DEPENDENCY=build/dependency -f DockerfileDev -t ${{secrets.DOCKERHUB_USERNAME}}/dotori-dev .
- name: Docker Push
run: docker push ${{secrets.DOCKERHUB_USERNAME}}/dotori-dev