Skip to content

Commit

Permalink
Feat/#10/endermaru (#14)
Browse files Browse the repository at this point in the history
* docker mysql add persistence

* minor changes

* github action 추가

* github action 추가2
  • Loading branch information
endermaru authored Dec 27, 2024
1 parent e62b535 commit e2cb0b3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,39 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

# 2. Log in to Docker Hub
# 2. Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'

# 3. Cache Gradle dependencies
- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# 4. Build the application with Gradle
- name: Build with Gradle
run: ./gradlew build

# 5. Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# 3. Build and tag the Docker image
# 6. Build and tag the Docker image
- name: Build Docker image
run: |
docker build -t endermaru/22-5-team1-server:latest .
docker build --build-arg JAR_FILE=build/libs/*.jar -t endermaru/22-5-team1-server:latest .
docker tag endermaru/22-5-team1-server:latest endermaru/22-5-team1-server:${{ github.sha }}
# 4. Push the Docker image to Docker Hub
# 7. Push the Docker image to Docker Hub
- name: Push Docker image
run: |
docker push endermaru/22-5-team1-server:latest
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ FROM openjdk:17
WORKDIR /app

# copy image to directory
COPY build/libs/*.jar app.jar
#COPY build/libs/*.jar app.jar
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} app.jar

# set port
EXPOSE 8080
Expand Down

0 comments on commit e2cb0b3

Please sign in to comment.