-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from aldairjpalma/master
working(kinda) woot woot
- Loading branch information
Showing
4 changed files
with
122 additions
and
3 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,32 @@ | ||
name: Build and Tag Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Environmental Variables | ||
run: | | ||
echo "GIT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: | | ||
itswebbibi/dadbot:latest | ||
itswebbibi/dadbot:${{ env.GIT_SHA }} |
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,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>DadBot</artifactId> | ||
<groupId>win.biosInterweb.discordBots</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>ARJI</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>net.dv8tion</groupId> | ||
<artifactId>JDA</artifactId> | ||
<version>5.0.0-alpha.22</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.github.cdimascio</groupId> | ||
<artifactId>dotenv-java</artifactId> | ||
<version>2.3.1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
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,28 @@ | ||
# Cloning Stage | ||
FROM alpine:3.18 AS clone | ||
|
||
RUN apk update && apk add --no-cache git | ||
|
||
WORKDIR /gittmp/ | ||
RUN git clone https://github.com/ARGamer36/DadBot.git | ||
WORKDIR /gittmp/DadBot/ | ||
RUN git clone https://github.com/ARGamer36/ARJI.git | ||
RUN mv /gittmp/DadBot/ARJIpom.xml /gittmp/DadBot/ARJI/pom.xml | ||
|
||
#Building Stage | ||
FROM maven:3.8.3-openjdk-17 AS build | ||
COPY --from=clone /gittmp/DadBot/ARJI/ /tmp/DadBot/ARJI/ | ||
COPY --from=clone /gittmp/DadBot/Driver/ /tmp/DadBot/Driver/ | ||
COPY --from=clone /gittmp/DadBot/pom.xml /tmp/DadBot/pom.xml | ||
#COPY --from=clone /gittmp/.gitmodules /tmp/.gitmodules | ||
|
||
WORKDIR /tmp/DadBot/ | ||
RUN mvn clean package | ||
|
||
# Run Stage | ||
FROM openjdk:17-alpine | ||
COPY --from=build /tmp/DadBot/Driver/target/*.jar /user/DadBot/Interweb-jar-with-dependencies.jar | ||
RUN mv /user/DadBot/Interweb-jar-with-dependencies.jar /user/DadBot/app.jar | ||
WORKDIR /user/DadBot/ | ||
RUN echo "$(TZ=$TZ date +'%m/%d/%Y %H:%M:%S %Z')" > buildInfo.txt | ||
CMD ["java", "-jar", "app.jar"] |
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