diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..099ed98 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Deploy to Vercel + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests (if any) + run: npm test --if-present + + - name: Deploy to Vercel + uses: amondnet/vercel-action@v25 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ secrets.ORG_ID }} + vercel-project-id: ${{ secrets.PROJECT_ID }} + vercel-args: '--prod' diff --git a/.github/workflows/railway-deploy.yml b/.github/workflows/railway-deploy.yml new file mode 100644 index 0000000..f85919a --- /dev/null +++ b/.github/workflows/railway-deploy.yml @@ -0,0 +1,19 @@ +name: Deploy to Railway + +on: + push: + branches: [ main, master ] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Deploy to Railway + uses: railway/deploy@v1 + with: + railway_token: ${{ secrets.RAILWAY_TOKEN }} + service: jaryo-file-manager diff --git a/render.yaml b/render.yaml new file mode 100644 index 0000000..b230060 --- /dev/null +++ b/render.yaml @@ -0,0 +1,12 @@ +services: + - type: web + name: jaryo-file-manager + env: node + plan: free + buildCommand: npm install + startCommand: npm start + envVars: + - key: NODE_ENV + value: production + - key: PORT + value: 10000 diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..3abfe8a --- /dev/null +++ b/vercel.json @@ -0,0 +1,23 @@ +{ + "version": 2, + "builds": [ + { + "src": "server.js", + "use": "@vercel/node" + } + ], + "routes": [ + { + "src": "/(.*)", + "dest": "/server.js" + } + ], + "env": { + "NODE_ENV": "production" + }, + "functions": { + "server.js": { + "maxDuration": 30 + } + } +}