Skip to content

This action builds a native image with GraalVM and deploys it to Railway.

License

Notifications You must be signed in to change notification settings

arielhernandezcl/build-graalvm-deploy-railway

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Build GraalVM Executable and Push To Railway

This GitHub Action builds a native GraalVM executable and deploys it to Railway.

Description

Railway uses nixpack to build images, but unfortunately it does not support GraalVM. This GitHub action allows you to build the executable and push it to Railway via the CLI along with a Dockerfile to build the image with the executable already created with GraalVM.

This action automates the process of building a native executable using GraalVM and then deploying it on the Railway platform. It is ideal for Java projects that want to take advantage of GraalVM and Railway's ease of deployment, overcoming existing compatibility limitations.

Inputs

This action requires two inputs:

  • RAILWAY_TOKEN (required): Authentication token for Railway.
  • SVC_ID (required): Service ID on Railway where the application will be deployed.

Requirements

  • Your project must support GraalVM and have a pom.xml configured for native compilation.
  • You must have a Railway account and have created a service for deployment.

Dockerfile Reference

Here is an example Dockerfile that you can use as a reference for your project:

FROM ghcr.io/graalvm/jdk-community:21
WORKDIR /app
COPY appBuild /app
EXPOSE 8080
CMD ["./appBuild"]

Notes

  • This action uses GraalVM Community Edition with Java 21. - ghcr.io/graalvm/jdk-community:21
  • Skips tests during compilation to speed up the process.
  • Remember that the name of the executable in the Dockerfile (appBuild) must match the name of the file generated by the GitHub action.
  • By using this action, you ensure that the native GraalVM executable is built correctly before being deployed to Railway, avoiding compatibility issues with nixpack.

Contributions

Contributions are welcome. Please open an issue or pull request in the action repository.

About

This action builds a native image with GraalVM and deploys it to Railway.

Resources

License

Stars

Watchers

Forks

Packages

No packages published