Skip to content

Commit

Permalink
actions: add build docker images workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hex-agon committed Jul 14, 2023
1 parent 04c446e commit 716a1dc
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Images

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest

permissions:
packages: write

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

- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 20
cache: maven

- name: Compile & install locally
run: mvn install --no-transfer-progress

- name: Build images
run: |
mvn jib:build --no-transfer-progress --pl resources-server -am
mvn jib:build --no-transfer-progress --pl login-server -am
mvn jib:build --no-transfer-progress --pl game-server -am
20 changes: 20 additions & 0 deletions game-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,24 @@
<version>${jackson.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<from>
<image>${jib.base.image}</image>
</from>
<to>
<image>ghcr.io/hex-agon/login-server:latest</image>
</to>
<container>
<appRoot>/alter-pangya/login-server</appRoot>
</container>
</configuration>
</plugin>
</plugins>
</build>
</project>
20 changes: 20 additions & 0 deletions login-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,24 @@
<version>${jackson.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<from>
<image>${jib.base.image}</image>
</from>
<to>
<image>ghcr.io/hex-agon/login-server:latest</image>
</to>
<container>
<appRoot>/alter-pangya/login-server</appRoot>
</container>
</configuration>
</plugin>
</plugins>
</build>
</project>
12 changes: 12 additions & 0 deletions networking/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,16 @@
<classifier>linux-x86_64</classifier>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
<log4j2.version>2.20.0</log4j2.version>
<junit.version>5.9.3</junit.version>
<mockito.version>5.4.0</mockito.version>
</properties>

<jib.version>3.3.2</jib.version>
<jib.base.image>eclipse-temurin:20-jre-alpine</jib.base.image>
</properties>

<repositories>
<repository>
Expand Down Expand Up @@ -123,5 +125,14 @@
<version>3.1.2</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
23 changes: 23 additions & 0 deletions resources-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,27 @@
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<from>
<image>${jib.base.image}</image>
</from>
<to>
<image>ghcr.io/hex-agon/resources-server:latest</image>
</to>
<container>
<appRoot>/alter-pangya/resources-server</appRoot>
<ports>
<port>50009/tcp</port>
</ports>
</container>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 716a1dc

Please sign in to comment.