mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 01:57:11 -05:00
60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
name: Deploy All Services
|
|
name: Deploy BlackRoad OS
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
serviceId:
|
|
description: "Optional service id to deploy"
|
|
required: false
|
|
type: string
|
|
description: "Optional service id to deploy (core, api, operator, agents, console, web, docs)"
|
|
required: false
|
|
default: ""
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NODE_ENV: production
|
|
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "18"
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Use Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Deploy services
|
|
run: |
|
|
if [ -n "${{ github.event.inputs.serviceId }}" ]; then
|
|
npm run deploy:service -- ${{ github.event.inputs.serviceId }}
|
|
else
|
|
- name: Deploy
|
|
env:
|
|
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
|
|
run: |
|
|
if [ -n "${{ github.event.inputs.serviceId }}" ]; then
|
|
echo "Deploying single service: ${{ github.event.inputs.serviceId }}"
|
|
npm run deploy:service -- ${{ github.event.inputs.serviceId }}
|
|
else
|
|
echo "Deploying all services"
|
|
npm run deploy:all
|
|
fi
|