cut code and add target dir to Dockerfile
All checks were successful
Gitea Action Maven build / build (push) Successful in 48s
Gitea Action Maven build / deploy (push) Successful in 7s

This commit is contained in:
Eduard Kuksa 2025-02-13 22:44:11 +07:00
parent e4a8acdace
commit 34938614e3
2 changed files with 2 additions and 6 deletions

View File

@ -62,11 +62,7 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Deploy to Local Server
run: |
scp -r artifact/* ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
# scp artifact/target/*.jar ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
# scp artifact/Dockerfile ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
# scp artifact/docker-compose.yml ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
run: scp -r artifact/* ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
- name: Build and Run Docker Image with Docker Compose
run: |
ssh ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }} << EOF

View File

@ -1,5 +1,5 @@
FROM openjdk:21-jdk-slim
WORKDIR /app
COPY spring-demo-0.1.1-SNAPSHOT.jar spring-demo-0.1.1-SNAPSHOT.jar
COPY target/spring-demo-0.1.1-SNAPSHOT.jar spring-demo-0.1.1-SNAPSHOT.jar
EXPOSE 8080
CMD ["java", "-jar", "spring-demo-0.1.1-SNAPSHOT.jar"]