Skip to content

Commit

Permalink
feat: 깃헙액션 배포 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
yunsbob committed Feb 16, 2025
1 parent 0a0d56f commit 4092e49
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ on:
- feature/release-test

jobs:
create-folder:
develop-release:
runs-on: ubuntu-latest

steps:
- name: test
- name: Checkout and Pull from develop
run: |
sshpass -p "${{ secrets.SSH_PASSWORD }}" ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << 'EOF'
cd /home/techmoa/techmoa-backend
git checkout develop
git pull origin develop
EOF
- name: Build and Deploy
run: |
sshpass -p "${{ secrets.SSH_PASSWORD }}" ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << 'EOF'
cd /home/techmoa/techmoa-backend
docker-compose up -d --build
docker image prune -f
EOF
18 changes: 18 additions & 0 deletions DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM openjdk:21-jdk-slim as builder

COPY gradlew .
COPY gradle gradle
COPY build.gradle .
COPY settings.gradle .
COPY src src

RUN chmod +x ./gradlew
RUN ./gradlew bootJar

FROM openjdk:21-jdk-slim

COPY --from=builder build/libs/*.jar app.jar

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "/app.jar"]
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.9"

services:
backend:
container_name: techmoa-backend
build: .
ports:
- "8080:8080"

0 comments on commit 4092e49

Please sign in to comment.