-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7276965
Showing
3 changed files
with
61 additions
and
0 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
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"] |
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,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 | |
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,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 }} |