From fbd89256682af77cb8916049f640f381905508ee Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Sun, 7 Apr 2024 00:27:09 -0400 Subject: [PATCH] CI Deployment --- .gitea/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ Dockerfile | 16 ++++++++++++++++ pom.xml | 2 ++ 3 files changed, 50 insertions(+) create mode 100644 .gitea/workflows/deploy.yml create mode 100644 Dockerfile diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..eaeffa5 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy App + +on: + push: + branches: ["master"] + paths-ignore: + - README.md + - LICENSE + - docker-compose.yml + +jobs: + docker: + strategy: + matrix: + arch: ["ubuntu-latest"] + git-version: ["2.44.0"] + runs-on: ${{ matrix.arch }} + + # Steps to run + steps: + # Checkout the repo + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Deploy to Dokku + - name: Deploy to Dokku + uses: dokku/github-action@master + with: + git_remote_url: "ssh://dokku@10.10.3.28:22/RESTfulMC" + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b8fc58a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM openjdk:17-jdk-slim + +# Copy project files +COPY . . + +# Build the app +RUN mvn clean package + +# Exposting on port 80 so we can +# access via a reverse proxy for Dokku +ENV HOSTNAME "0.0.0.0" +EXPOSE 80 +ENV PORT 80 + +# Start the app +CMD ["java", "-jar", "target/RESTfulMC.jar"] \ No newline at end of file diff --git a/pom.xml b/pom.xml index 91e3cc4..f022f05 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,9 @@ + ${project.artifactId} + org.springframework.boot spring-boot-maven-plugin