Skip to content
Trying to deploy a PR on open
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 }}
Closed$10 Bounty

5 Replies

musclepull
OP

a year ago

35a56054-3937-4ab5-b2dd-ec0696cbb65c


musclepull
OP

a year ago


musclepull
OP

a year ago

35a56054-3937-4ab5-b2dd-ec0696cbb65c


a year ago

In the `RAILWAY_TOKEN` field are you putting a user token or project token?


musclepull
OP

a year ago

I used the API tokens in Account Settings

1388195666756370622


Welcome!

Sign in to your Railway account to join the conversation.

Loading...