Skip to content

Commit 47d81bd

Browse files
authored
Merge pull request #5 from Profect-4th-IRUM/test/#4-docker-compose
[Test] Docker Compose CD 작성
2 parents b3a95f1 + 936e4b4 commit 47d81bd

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/dockerhub_cd.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: dockerhub_cd.yml
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
docker-build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
14+
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
15+
16+
steps:
17+
- name: Checkout source
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Java
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: 'temurin'
24+
java-version: 21
25+
26+
- run: chmod +x ./gradlew
27+
28+
- name: Run tests
29+
run: ./gradlew test
30+
31+
- name: Build JAR
32+
run: ./gradlew build
33+
34+
- name: Docker login
35+
uses: docker/login-action@v3
36+
with:
37+
username: ${{ secrets.DOCKERHUB_USERNAME }}
38+
password: ${{ secrets.DOCKERHUB_TOKEN }}
39+
40+
- name: Build and push Docker image
41+
uses: docker/build-push-action@v5
42+
with:
43+
context: .
44+
push: true
45+
tags: |
46+
sunwoo11/come2us-config-server:latest

0 commit comments

Comments
 (0)