-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |