-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
55 lines (44 loc) · 1.32 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build GraalVM Executable and Push To Railway
description: Build a GraalVM native executable and deploy it to Railway using GitHub Actions.
inputs:
RAILWAY_TOKEN:
description: 'Railway authentication token'
required: true
default: ''
SVC_ID:
description: 'Service ID for Railway'
required: true
default: ''
runs:
using: 'composite'
steps:
- name: Checkout code
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=${{ inputs.SVC_ID }}
env:
RAILWAY_TOKEN: ${{ inputs.RAILWAY_TOKEN }}
SVC_ID: ${{ inputs.SVC_ID }}
branding:
color: 'blue'
icon: 'terminal'