Skip to content

Commit

Permalink
Merge pull request #222 from Kaktushose/rewrite
Browse files Browse the repository at this point in the history
Release 3.0.0
  • Loading branch information
Kaktushose authored Jul 2, 2024
2 parents f6a638d + a00fb6f commit ed00384
Show file tree
Hide file tree
Showing 140 changed files with 6,086 additions and 7,702 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
POSTGRES_DB=database
POSTGRES_USER=user
POSTGRES_PASSWORD=password
POSTGRES_URL=jdbc:postgresql://postgres:5432/database
GF_SECURITY_ADMIN_PASSWORD=password
BOT_GUILD=0123456789
BOT_TOKEN=bot_token
36 changes: 26 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,36 @@ name: Deploy

on:
push:
branches: [ master ]
branches: [ main ]
workflow_dispatch:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- name: Execute build script via ssh
uses: appleboy/ssh-action@master
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: nplaybot
tags: latest ${{ github.sha }}
containerfiles: |
./Dockerfile
oci: false

- name: Push To ghcr.io
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: nohup bash /home/levelbot/scripts/workflow.sh > /home/levelbot/scripts/nohup.log 2>&1 & tail -f /home/levelbot/scripts/nohup.log &
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/kaktushose/nplay-bot
username: Kaktushose
password: ${{ github.token }}
extra-args: |
--disable-content-trust
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}"
10 changes: 5 additions & 5 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ name: Java CI

on:
push:
branches: [ master, dev ]
branches: [ main, development, rewrite ]
pull_request:
branches: [ master, dev ]
branches: [ main, development, rewrite ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 21
- name: Build with Maven
run: mvn -B package --file pom.xml
37 changes: 34 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
### IntelliJ ###
out/
.idea/
*.iml
modules.xml
*.ipr

### Java ###
# Compiled class file
*.class
# Log file
*.log
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

### Maven ###
target/
logs/
src/main/resources/application.properties
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
*.iml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

### Project ###
*.env
/data
/logs
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM redgate/flyway as flyway

WORKDIR /flyway


FROM maven:3.9.5-amazoncorretto-21-debian AS builder

WORKDIR /bot
COPY . .
RUN mvn clean package -DskipTests

FROM openjdk:21

COPY --from=flyway /flyway ./flyway
COPY src/main/resources/db/migration ./db/migration

COPY --from=builder /bot/*.sh .
COPY --from=builder /bot/target/NPLAY-Bot.jar ./NPLAY-Bot.jar
COPY --from=builder /bot/embeds.json .

RUN chmod +x ./wait-for-it.sh ./entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]
CMD ["java", "-jar", "NPLAY-Bot.jar"]
Loading

0 comments on commit ed00384

Please sign in to comment.