Skip to content

chore(deps): bump @anthropic-ai/claude-code from 2.1.77 to 2.1.78 #280

chore(deps): bump @anthropic-ai/claude-code from 2.1.77 to 2.1.78

chore(deps): bump @anthropic-ai/claude-code from 2.1.77 to 2.1.78 #280

Workflow file for this run

name: Railway Preview Deploy
on:
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [main]
concurrency:
group: railway-preview-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
deploy-preview:
name: Deploy to Railway Preview
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build web dashboard
run: cd web && pnpm build
env:
NEXT_PUBLIC_BOT_API_URL: ${{ secrets.NEXT_PUBLIC_BOT_API_URL }}
NEXT_PUBLIC_DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL_PREVIEW || 'https://preview.volvox.dev' }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
DISCORD_CLIENT_SECRET: ${{ secrets.DISCORD_CLIENT_SECRET }}
- name: Install Railway CLI
run: npm install -g @railway/cli
- name: Deploy to Railway Preview
id: railway-deploy
run: |
# Generate a unique preview environment name based on PR number
PREVIEW_ENV="pr-${{ github.event.number }}"
echo "Deploying to preview environment: $PREVIEW_ENV"
# Deploy using Railway CLI
railway up --service=volvox-bot --environment=$PREVIEW_ENV --detach
# Get the deployment URL
DEPLOY_URL=$(railway domain --service=volvox-bot --environment=$PREVIEW_ENV)
echo "deploy_url=$DEPLOY_URL" >> $GITHUB_OUTPUT
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
- name: Comment PR with preview URL
uses: actions/[email protected]
with:
script: |
const deployUrl = '${{ steps.railway-deploy.outputs.deploy_url }}';
const prNumber = context.issue.number;
// Find existing comment
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
});
const botComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('🚀 Railway Preview Deployment')
);
const body = `## 🚀 Railway Preview Deployment
Your PR has been deployed to a preview environment!
**Preview URL:** ${deployUrl}
**Environment:** \`pr-${prNumber}\`
This deployment will be updated automatically when you push new commits.
---
*Last updated: ${new Date().toISOString()}*`;
if (botComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: body,
});
} else {
// Create new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: body,
});
}
cleanup-preview:
name: Cleanup Railway Preview
runs-on: ubuntu-latest
if: github.event.action == 'closed'
steps:
- name: Install Railway CLI
run: npm install -g @railway/cli
- name: Remove Preview Environment
run: |
PREVIEW_ENV="pr-${{ github.event.number }}"
echo "Removing preview environment: $PREVIEW_ENV"
railway environment delete $PREVIEW_ENV --yes || true
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
- name: Comment PR about cleanup
uses: actions/[email protected]
with:
script: |
const prNumber = context.issue.number;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: `## 🧹 Preview Environment Cleaned Up
The Railway preview environment for this PR has been removed.
**Environment:** \`pr-${prNumber}\``,
});