Giter VIP home page Giter VIP logo

slack-hubot-typescript's Introduction

slack-hubot-typescript

hubotをTypeScriptでかけるようにしました。 Herokuで動きます。

scriptの追加

/src/*.tsに書いて、 npm run buildしてください。

ローカルでテストする

環境変数HUBOT_SLACK_TOKENにHubot Appのトークンをセットして以下のコマンドで起動

HUBOT_SLACK_TOKEN=xoxb-xxxx ./bin/hubot --adapter slack

Herokuで運用する

Herokuの登録とCLI設定は済ませておく。

// Herokuアプリを作成
$ heroku create {アプリ名}

// 環境変数としてSlack Hubot AppのTokenをセット
$ heroku config:add HUBOT_SLACK_TOKEN={hubotのToken}

// Heroku側でビルドしたいので
$ heroku config:add NPM_CONFIG_PRODUCTION=false

// デプロイ
$ git push heroku master

// ログのStreamはこれで見ましょう
$ heroku logs --tail

Herokuのタイムゾーンを東京にする

デフォルトだと、22:00 ~ 6:00でHerokuが寝ます(無料Dynoの場合)

hubot-heroku-keepalive でHerokuを起動し続けているので、詳細はそちらを参照してください。

$ heroku config:add TZ=Asia/Tokyo

GitHub Actionsを使ってデプロイする

.github/workflowsに設定している。

GitHubのSecretsに以下をセットすれば、 masterにpushで自動デプロイされる。

HEROKU_API_KEY={HerokuのAPI Key}
HEROKU_APP_NAME={Herokuのアプリ名}
HEROKU_EMAIL={Herokuで使用するメールアドレス}

参考

https://github.com/AkhileshNS/heroku-deploy

slack-hubot-typescript's People

Contributors

hikaru-ito avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.