Skip to content

Commit

Permalink
Added deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
rojikaru committed Jan 24, 2024
1 parent b6efcab commit fa00e6b
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 11 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/fly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Fly Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use an official OpenJDK runtime as a parent image
FROM maven:3.9.6-eclipse-temurin-21-alpine

# Create new app directory
RUN mkdir /app

# Set the working directory in the container
WORKDIR /app

# Copy the project files
COPY /src ./src
COPY pom.xml .

# Compile the Java source code
RUN mvn clean compile assembly:single

# Specify the command to run on container start
CMD ["java", "-jar", "./target/HentaiBot-1.1-jar-with-dependencies.jar"]
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

14 changes: 14 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fly.toml app configuration file generated for hentaibot on 2024-01-24T20:04:36+02:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "hentaibot"
primary_region = "waw"

[build]

[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 256
34 changes: 25 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,32 @@
<build>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals><goal>copy-dependencies</goal></goals>
</execution>
</executions>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.hentaibot.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.hentaibot.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/hentaibot/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static void main(String[] args) {
TelegramBotsApi botsApi
= new TelegramBotsApi(DefaultBotSession.class);
botsApi.registerBot(new HentaiBot(botName, botToken));

} catch (TelegramApiException e) {
throw new RuntimeException(e);
}
Expand Down
1 change: 0 additions & 1 deletion system.properties

This file was deleted.

0 comments on commit fa00e6b

Please sign in to comment.