-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dwertent <[email protected]>
- Loading branch information
Showing
5 changed files
with
180 additions
and
6 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
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,65 @@ | ||
name: build | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
IMAGE_REGISTRY: | ||
required: false | ||
description: 'image registry' | ||
default: '' | ||
IMAGE_NAME: | ||
required: false | ||
description: 'Name of the image to build' | ||
default: 'paladin' | ||
IMAGE_TAG: | ||
required: false | ||
description: 'Version of the image to build' | ||
default: 'latest' | ||
BUILD_PLATFORM: | ||
required: false | ||
description: 'Platform to build the image for' | ||
default: 'linux/amd64' | ||
# default: 'linux/amd64,linux/arm64' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- uses: actions/download-artifact@v4 | ||
name: Download build artifacts | ||
with: | ||
name: paladin-libs | ||
path: build/libs/ | ||
if-no-files-found: error | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# TODO: Setup docker registry | ||
# - name: Login to Docker registry | ||
# if: ${{ inputs.IMAGE_REGISTRY != '' }} | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# registry: ${{ inputs.IMAGE_REGISTRY }} | ||
# username: ${{ secrets.REGISTRY_USERNAME }} | ||
# password: ${{ secrets.REGISTRY_PASSWORD }} | ||
|
||
- name: Build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
tags: ${{ inputs.IMAGE_REGISTRY }}/${{ inputs.IMAGE_NAME }}:${{ inputs.IMAGE_TAG }} | ||
build-args: image_version=${{ inputs.IMAGE_TAG }} | ||
platforms: ${{ inputs.BUILD_PLATFORM }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: false |
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,62 @@ | ||
name: PR | ||
permissions: read-all | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
paths-ignore: | ||
- '**.sh' | ||
- 'docs/*' | ||
- 'build/*' | ||
- '.github/*' | ||
# - '**.md' // Uncomment this line to ignore all markdown files | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test-and-build: | ||
permissions: | ||
actions: read | ||
checks: read | ||
deployments: read | ||
id-token: write | ||
issues: read | ||
discussions: read | ||
packages: read | ||
pages: read | ||
pull-requests: write | ||
repository-projects: read | ||
security-events: read | ||
statuses: read | ||
attestations: read | ||
contents: write | ||
uses: ./.github/workflows/build.yaml | ||
secrets: inherit | ||
with: | ||
ARTIFACTS_PATH: buils/libs | ||
|
||
build-image: | ||
permissions: | ||
actions: read | ||
checks: read | ||
contents: write | ||
deployments: read | ||
discussions: read | ||
id-token: write | ||
issues: read | ||
packages: write | ||
pages: read | ||
pull-requests: read | ||
repository-projects: read | ||
security-events: read | ||
statuses: read | ||
attestations: read | ||
uses: ./.github/workflows/image-build.yaml | ||
with: | ||
ARTIFACTS_PATH: buils/libs | ||
IMAGE_NAME: paladin | ||
IMAGE_TAG: pr-test | ||
BUILD_PLATFORM: linux/amd64 | ||
|
||
secrets: inherit |
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,35 @@ | ||
FROM ubuntu:24.04 | ||
|
||
# Install Java (JRE only) and other necessary dependencies | ||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y openjdk-21-jre-headless && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the JAR file and necessary libraries | ||
COPY build/libs/ libs/ | ||
|
||
# placehoolder: expose ports | ||
# EXPOSE <port> | ||
|
||
# placehoolder: entrypoint | ||
# ENTRYPOINT ["paladin"] | ||
|
||
# Run the JAR file | ||
# Override this with `docker run --entrypoint` | ||
ENTRYPOINT ["java", "-Djna.library.path=/app/libs", "-jar", "app/libs/paladin.jar"] | ||
|
||
# Default command-line arguments (config file and node name) | ||
# Override this with docker run <image> /app/other-config.yaml another-node | ||
|
||
CMD ["app/config.paladin.yaml", "node"] | ||
|
||
# Override the default command-line arguments | ||
# docker run -d -p <>:<> \ | ||
# -v <path to config file on host>:<path to config file> \ | ||
# <image> \ | ||
# -Djna.library.path=/app \ | ||
# -jar paladin.jar <path to config file> <node name> |
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