-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/migrate to digitalocean #77
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
81ce923
feat: complete email verification and SEO setup
Mayank-saraswal 01ccc44
feat: migrate subscription billing from Polar to Razorpay
Mayank-saraswal 15a04ec
feat: implement subscription billing system with Razorpay integration…
Mayank-saraswal c54a7bf
feat: migrate from Azure to DigitalOcean (App Platform + Spaces)
Mayank-saraswal 4631312
feat: initialize global CSS with Tailwind configuration, custom theme…
Mayank-saraswal a6d610d
fix: resolve TypeScript errors in postgres executor
Mayank-saraswal fe3a8fa
feat: implement WhatsApp execution node, add SEO metadata, and introd…
Mayank-saraswal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| name: Build and Deploy to DigitalOcean | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| env: | ||
| REGISTRY: registry.digitalocean.com/nodebase | ||
| IMAGE_NAME: nodebase | ||
|
|
||
| jobs: | ||
| # ─── Build & Push Docker image to DigitalOcean Container Registry ─── | ||
| build-and-push: | ||
| name: Build & Push to DOCR | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install doctl | ||
| uses: digitalocean/action-doctl@v2 | ||
| with: | ||
| token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | ||
|
|
||
| - name: Log in to DigitalOcean Container Registry | ||
| run: doctl registry login --expiry-seconds 1200 | ||
|
|
||
| - name: Build Docker image | ||
| run: | | ||
| docker build \ | ||
| -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ github.sha }} \ | ||
| -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ | ||
| . | ||
|
|
||
| - name: Push Docker image | ||
| run: | | ||
| docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ github.sha }} | ||
| docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
|
|
||
| # ─── Deploy to DigitalOcean App Platform ──────────────────────────── | ||
| deploy: | ||
| name: Deploy to App Platform | ||
| runs-on: ubuntu-latest | ||
| needs: build-and-push | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
|
|
||
| steps: | ||
| - name: Install doctl | ||
| uses: digitalocean/action-doctl@v2 | ||
| with: | ||
| token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | ||
|
|
||
| - name: Deploy to App Platform | ||
| env: | ||
| APP_ID: ${{ secrets.APP_ID }} | ||
| APP_NAME: nodebase | ||
| run: | | ||
| if [ -z "$APP_ID" ]; then | ||
| for candidate_id in $(doctl apps list --format ID --no-header); do | ||
| candidate_name=$(doctl apps get "$candidate_id" --format Spec.Name --no-header) | ||
| if [ "$candidate_name" = "$APP_NAME" ]; then | ||
| APP_ID="$candidate_id" | ||
| break | ||
| fi | ||
| done | ||
| fi | ||
| if [ -z "$APP_ID" ]; then | ||
| echo "❌ No App Platform app found. Create one first in DigitalOcean console." | ||
| exit 1 | ||
| fi | ||
| echo "🚀 Triggering deployment for App: $APP_ID" | ||
| doctl apps create-deployment "$APP_ID" --wait | ||
| echo "✅ Deployment complete!" | ||
|
|
||
| # ─── PR Build Validation ──────────────────────────────────────────── | ||
| build-check: | ||
| name: Validate build (PR only) | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'pull_request' | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Generate Prisma client | ||
| run: npx prisma generate | ||
|
|
||
| - name: Type check | ||
| run: npx tsc --noEmit | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
| env: | ||
| NODE_OPTIONS: "--max-old-space-size=4096" | ||
| DATABASE_URL: "postgresql://dummy:dummy@dummy:5432/dummy" | ||
| DIRECT_DATABASE_URL: "postgresql://dummy:dummy@dummy:5432/dummy" | ||
| BETTER_AUTH_SECRET: "dummy-secret-for-build-only" | ||
| BETTER_AUTH_URL: "https://nodebase.tech" | ||
| NEXT_PUBLIC_BETTER_AUTH_URL: "https://nodebase.tech" | ||
| NEXT_PUBLIC_APP_URL: "https://nodebase.tech" | ||
| INNGEST_SIGNING_KEY: "signkey-prod-dummy" | ||
| INNGEST_EVENT_KEY: "dummy-event-key" | ||
| ENCRYPTION_KEY: "dummy-encryption-key-32-characters" | ||
| GOOGLE_CLIENT_ID: "dummy" | ||
| GOOGLE_CLIENT_SECRET: "dummy" | ||
| GOOGLE_GMAIL_CLIENT_ID: "dummy" | ||
| GOOGLE_GMAIL_CLIENT_SECRET: "dummy" | ||
| GOOGLE_SHEETS_CLIENT_ID: "dummy" | ||
| GOOGLE_SHEETS_CLIENT_SECRET: "dummy" | ||
| GOOGLE_DRIVE_CLIENT_ID: "dummy" | ||
| GOOGLE_DRIVE_CLIENT_SECRET: "dummy" | ||
| GITHUB_CLIENT_ID: "dummy" | ||
| GITHUB_CLIENT_SECRET: "dummy" | ||
| GROQ_API_KEY: "dummy" | ||
| GOOGLE_GENERATIVE_AI_API_KEY: "dummy" | ||
| POLAR_ACCESS_TOKEN: "dummy" | ||
| POLAR_WEBHOOK_SECRET: "dummy" | ||
| SENTRY_AUTH_TOKEN: "dummy" | ||
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
.github/workflows/nodebase-app-AutoDeployTrigger-5e61cb78-dd30-4542-9ea3-615a7ad15fd2.yml
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /** @type {import('next-sitemap').IConfig} */ | ||
| module.exports = { | ||
| siteUrl: "https://nodebase.tech", | ||
| generateRobotsTxt: true, | ||
| generateIndexSitemap: false, | ||
| changefreq: "weekly", | ||
| priority: 0.7, | ||
| sitemapSize: 5000, | ||
| exclude: [ | ||
| "/workflows/*", | ||
| "/editor/*", | ||
| "/settings/*", | ||
| "/api/*", | ||
| "/verify-email", | ||
| "/check-email", | ||
| "/resend-verification", | ||
| ], | ||
| additionalPaths: async (config) => [ | ||
| await config.transform(config, "/"), | ||
| await config.transform(config, "/pricing"), | ||
| await config.transform(config, "/blog"), | ||
| await config.transform(config, "/integrations"), | ||
| await config.transform(config, "/login"), | ||
| await config.transform(config, "/signup"), | ||
| ], | ||
| robotsTxtOptions: { | ||
| policies: [ | ||
| { | ||
| userAgent: "*", | ||
| allow: "/", | ||
| disallow: ["/workflows/", "/editor/", "/settings/", "/api/"], | ||
| }, | ||
| { | ||
| userAgent: "Googlebot", | ||
| allow: "/", | ||
| disallow: ["/workflows/", "/editor/", "/settings/"], | ||
| }, | ||
| ], | ||
| }, | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.