Skip to content

Commit

Permalink
First Push
Browse files Browse the repository at this point in the history
  • Loading branch information
arielhernandezcl committed Sep 10, 2024
0 parents commit 7276965
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ghcr.io/graalvm/jdk-community:21
WORKDIR /app
COPY appBuild /app
EXPOSE 8080
CMD ["./appBuild"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Build and Deploy to Railway GitHub Action

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

## Inputs

| Input | Description | Required |
|-------|-------------|----------|
| `railway-token` | Railway authentication token | Yes |
| `svc-id` | Service ID for Railway | Yes |
46 changes: 46 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build GraalVM Executable and Push To Railway

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm-community'

- name: Build with Maven
run: mvn -Pnative native:compile -DskipTests

- name: Move Executable
run: mv ./target/appBuild ./

- name: Install Railway CLI
run: npm i -g @railway/cli

- name: Verify Railway CLI installation
run: railway --version

- name: Deploy to Railway
run: railway up --service=${{ secrets.SVC_ID }}
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
SVC_ID: ${{ secrets.SVC_ID }}

0 comments on commit 7276965

Please sign in to comment.