Skip to content

Commit

Permalink
added docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
FusselTV committed Oct 10, 2023
1 parent 8d30ffb commit b716ffb
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Publish Docker Container

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 19
cache: 'gradle'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
gradle-home-cache-cleanup: true

- name: Run build with Gradle wrapper
run: ./gradlew shadowJar

- name: Docker Login
uses: docker/login-action@v2
with:
username: fusseltv
password: dckr_pat_uxkzMELfS138kGYEyBYsPjxMF7c

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: fusseltv/gym-webhook:latest
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Use openjdk image version 19 as the base image
FROM eclipse-temurin:19-jre-alpine

# Update the packages in the image
RUN apk update && apk upgrade

# Set the working directory
WORKDIR /app

# Copy the JDA bot code to the working directory
COPY ./build/libs/StaffWebhook.jar .

# Run the JDA bot jar file, passing in the environment variables as command line arguments
CMD ["java", "-jar", "StaffWebhook.jar"]

# Set the user and group to non-root
USER 1001:0

0 comments on commit b716ffb

Please sign in to comment.