Skip to content

feat: SMS/WhatsApp notifications for remote Claude interaction #1

feat: SMS/WhatsApp notifications for remote Claude interaction

feat: SMS/WhatsApp notifications for remote Claude interaction #1

Workflow file for this run

name: Railway Preview Deployment
on:
pull_request:
types: [opened, synchronize, reopened]
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
jobs:
preview:
name: Deploy Preview to Railway
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
continue-on-error: true
- name: Build project
run: npm run build
- name: Install Railway CLI
run: npm install -g @railway/cli
- name: Deploy Preview Environment
id: deploy
run: |
railway link ${{ secrets.RAILWAY_PROJECT_ID }}
railway environment create pr-${{ github.event.pull_request.number }} || true
railway environment pr-${{ github.event.pull_request.number }}
railway up --detach
echo "environment=pr-${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
- name: Get preview URL
id: preview
run: |
echo "url=$(railway status --json | jq -r '.url')" >> $GITHUB_OUTPUT
continue-on-error: true
- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
const preview_url = '${{ steps.preview.outputs.url }}';
const environment = '${{ steps.deploy.outputs.environment }}';
const message = preview_url
? `🚀 Preview deployed to Railway\n\nEnvironment: \`${environment}\`\nURL: ${preview_url}\n\n_This preview will be automatically cleaned up when the PR is merged or closed._`
: `🚀 Preview deployed to Railway\n\nEnvironment: \`${environment}\`\n\n_This preview will be automatically cleaned up when the PR is merged or closed._`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message
});
continue-on-error: true