This commit is contained in:
parent
7262188add
commit
5fb7c77d70
@ -0,0 +1,31 @@
|
||||
name: Deploy to Dokku
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- .gitignore
|
||||
- README.md
|
||||
- LICENSE
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ["ubuntu-latest"]
|
||||
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: Push to dokku
|
||||
uses: dokku/github-action@master
|
||||
with:
|
||||
git_remote_url: "ssh://dokku@10.0.50.136:22/bat"
|
||||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
# Stage 1: Build the application
|
||||
FROM maven:3.9.8-eclipse-temurin-17-alpine AS builder
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /home/container
|
||||
|
||||
# Copy the source code
|
||||
COPY . .
|
||||
|
||||
# Build the jar
|
||||
RUN mvn package -q -Dmaven.test.skip -DskipTests -T2C
|
||||
|
||||
# Stage 2: Create the final lightweight image
|
||||
FROM eclipse-temurin:17.0.11_9-jre-focal
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /home/container
|
||||
|
||||
# Copy the built jar file from the builder stage
|
||||
COPY --from=builder /home/container/target/YetAnotherBeatSaberTracker.jar .
|
||||
|
||||
# Export the port
|
||||
ENV PORT=7500
|
||||
EXPOSE $PORT
|
||||
|
||||
# Run the jar file
|
||||
CMD java -jar YetAnotherBeatSaberTracker.jar -Djava.awt.headless=true
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cc.fascinated</groupId>
|
||||
<artifactId>YetAnotherBeatSaberTracker</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>1.0</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
Reference in New Issue
Block a user