Compare commits
2 Commits
a5b4982b41
...
a2b8e1f4e0
| Author | SHA1 | Date | |
|---|---|---|---|
| a2b8e1f4e0 | |||
|
|
91a79e7ae1 |
36
.github/workflows/railway-deploy.yml
vendored
Normal file
36
.github/workflows/railway-deploy.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Deploy to Railway
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v1
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
|
||||||
|
- name: Install Railway CLI
|
||||||
|
run: npm i -g @railway/cli
|
||||||
|
|
||||||
|
- name: Deploy with Railway
|
||||||
|
env:
|
||||||
|
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
|
||||||
|
RAILWAY_PROJECT_ID: ${{ secrets.RAILWAY_PROJECT_ID }}
|
||||||
|
RAILWAY_SERVICE_ID: ${{ secrets.RAILWAY_SERVICE_ID }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
PROJECT_FLAG=""
|
||||||
|
SERVICE_FLAG=""
|
||||||
|
if [ -n "${RAILWAY_PROJECT_ID:-}" ]; then PROJECT_FLAG="--project ${RAILWAY_PROJECT_ID}"; fi
|
||||||
|
if [ -n "${RAILWAY_SERVICE_ID:-}" ]; then SERVICE_FLAG="--service ${RAILWAY_SERVICE_ID}"; fi
|
||||||
|
# Deploy current repo; --yes to skip prompts
|
||||||
|
railway up $PROJECT_FLAG $SERVICE_FLAG --yes
|
||||||
|
|
||||||
13
index.ts
13
index.ts
@@ -1 +1,12 @@
|
|||||||
console.log("Hello via Bun!");
|
const port = Number(process.env.PORT || 3000);
|
||||||
|
|
||||||
|
const server = Bun.serve({
|
||||||
|
port,
|
||||||
|
fetch(_req) {
|
||||||
|
return new Response("Hello via Bun!", {
|
||||||
|
headers: { "content-type": "text/plain; charset=utf-8" },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Server running on http://localhost:${server.port}`);
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"start": "bun run index.ts"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "latest"
|
"@types/bun": "latest"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user