fix: Update CLI version to 0.3.17 #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Railway | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| workflow_dispatch: | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
| jobs: | |
| deploy: | |
| name: Deploy 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 to Railway | |
| run: | | |
| railway link ${{ secrets.RAILWAY_PROJECT_ID }} | |
| railway up --detach | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
| - name: Get deployment URL | |
| id: deployment | |
| run: | | |
| echo "url=$(railway status --json | jq -r '.url')" >> $GITHUB_OUTPUT | |
| continue-on-error: true | |
| - name: Comment on commit | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const deployment_url = '${{ steps.deployment.outputs.url }}'; | |
| const message = deployment_url | |
| ? `✅ Deployed to Railway: ${deployment_url}` | |
| : '✅ Deployed to Railway successfully'; | |
| github.rest.repos.createCommitComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| commit_sha: context.sha, | |
| body: message | |
| }); | |
| continue-on-error: true |