musclepull
OP
a year ago
As the title says, trying to deploy on PR open. However, greeted with the:
Deploying PR #94 to preview environment...
š Linking to existing project: ***
Unauthorized. Please login with railway login
When I do try to authenticate, I get the non-interactive constraint
This is my workflow:
- name: Deploy to PR Preview Environment
run: |
echo "š Deploying PR #${{ github.event.number }} to preview environment..."
# Link to your existing project
echo "š Linking to existing project: ${{ secrets.RAILWAY_PROJECT_ID }}"
railway link --project ${{ secrets.RAILWAY_PROJECT_ID }}
# Add database service if this is a new environment
echo "šļø Ensuring database service exists..."
railway add postgresql 2>/dev/null || echo "PostgreSQL service may already exist"
# Deploy the application
echo "š Starting deployment..."
railway deploy --detach
echo "ā³ Waiting for deployment to complete..."
sleep 60
echo "š Checking deployment status..."
railway status
echo "š Getting application URL..."
DEPLOY_URL=$(railway domain 2>/dev/null || echo "Domain will be auto-assigned")
echo "ā
PR deployment complete!"
echo "š Application URL: $DEPLOY_URL"
echo "š Environment: $ENVIRONMENT_NAME"
env:
RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_TOKEN }}5 Replies
I used the API tokens in Account Settings