name: Deploy to Railway on: push: branches: ["main"] pull_request: branches: ["main"] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" - name: Enable corepack run: corepack enable - name: Install dependencies run: pnpm install --frozen-lockfile || npm install - name: Build run: pnpm build || npm run build || echo "No build step" - name: Test run: pnpm test || npm test || echo "No tests" deploy: needs: build runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v4 - name: Install Railway CLI run: npm install -g @railway/cli - name: Deploy to Railway run: railway up --service blackroad-os-pack-legal env: RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}