diff --git a/.github/workflows/deploy-github-app.yml b/.github/workflows/deploy-github-app.yml new file mode 100644 index 00000000..32ec9b39 --- /dev/null +++ b/.github/workflows/deploy-github-app.yml @@ -0,0 +1,31 @@ +name: "Deployment Tailchat Github App" + +on: + push: + branches: + - master + paths: + - "app/github-app/**" + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + defaults: + run: + working-directory: app/github-app + steps: + - uses: actions/checkout@v1 + - name: Deploy to Vercel + uses: amondnet/vercel-action@master + env: + VERSION: ${{ env.GITHUB_SHA }} + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ secrets.ORG_ID}} + vercel-project-id: prj_KwCzbuSaEj3XmP0sYvvnqqiK7nCW + working-directory: ./ + vercel-args: '--prod' diff --git a/apps/github-app/api/github/webhooks/index.js b/apps/github-app/api/github/webhooks/index.js new file mode 100644 index 00000000..becf8065 --- /dev/null +++ b/apps/github-app/api/github/webhooks/index.js @@ -0,0 +1,10 @@ +// For vercel +// Reference: https://probot.github.io/docs/deployment/#vercel + +const { createNodeMiddleware, createProbot } = require('probot'); +const app = require('../../../src/app').app; + +module.exports = createNodeMiddleware(app, { + probot: createProbot(), + webhooksPath: '/api/github/webhooks', +}); diff --git a/apps/github-app/package.json b/apps/github-app/package.json index ab33cd26..c40b4da2 100644 --- a/apps/github-app/package.json +++ b/apps/github-app/package.json @@ -14,6 +14,7 @@ "scripts": { "dev": "nodemon --watch \"src/**\" --ext \"ts\" --ignore \"src/**/*.spec.ts\" --exec \"ts-node --transpile-only src/index.ts\"", "build": "tsc", + "prepare": "tsc", "test": "jest" }, "dependencies": { diff --git a/apps/github-app/public/favicon.ico b/apps/github-app/public/favicon.ico new file mode 100644 index 00000000..94ac22cf Binary files /dev/null and b/apps/github-app/public/favicon.ico differ