-
Notifications
You must be signed in to change notification settings - Fork 2
feat(web): landing page redesign with Terminal Chic aesthetic #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 21 commits
49802c0
5eb1b5c
db6d10a
405d585
8c01343
5a493ef
4ec14de
e7e07c0
978d89d
bca628f
6191554
4bfe414
152534c
73b6bf0
79e2ad7
5c9eef3
30f29d8
f6f2cae
f19eb3c
66120bd
e83b855
23a7acf
08bcb3b
44ad7b2
5cb6ebc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,148 @@ | ||||||
| name: Railway Preview Deploy | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| types: [opened, synchronize, reopened] | ||||||
BillChirico marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| branches: [main] | ||||||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| 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 | ||||||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deploy job runs unnecessarily when PR closes when action is
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: .github/workflows/railway-preview.yml
Line: 20
Comment:
deploy job runs unnecessarily when PR closes
when action is `closed`, both deploy-preview and cleanup-preview jobs run simultaneously, wasting CI resources. add condition to skip:
```suggestion
if: github.event.action != 'closed' && github.event.pull_request.head.repo.full_name == github.repository
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/[email protected] | ||||||
|
|
||||||
| - name: Setup pnpm | ||||||
| uses: pnpm/[email protected] | ||||||
|
||||||
|
|
||||||
| - 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 }} | ||||||
| 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 }} | ||||||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - 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 }} | ||||||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - 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') | ||||||
| ); | ||||||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| 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' | ||||||
|
|
||||||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| 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}\``, | ||||||
| }); | ||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.