diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..358581b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.env* +node_modules +*.pem +.env* diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..bdbf01b --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,20 @@ +name: docker +on: + push: +jobs: + docker: + name: docker + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v1 + - name: build-push + uses: docker/build-push-action@v1.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.GITHUB_REPOSITORY }} + tag_with_ref: true + push: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }} + always_pull: true + add_git_labels: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index fd9f2d2..84c5a8a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ node_modules npm-debug.log *.pem -.env +.env* package-lock.json config/kubernetes/*/secrets/* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 72fb549..0000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -sudo: false -language: node_js -node_js: - - "10" -notifications: - disabled: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ed74134 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:10 + +WORKDIR /usr/src/app +COPY package*.json yarn.* ./ + +RUN yarn +COPY . . +ENV PORT 8888 +EXPOSE 8888 +CMD [ "node_modules/.bin/probot", "run", "index.js" ] diff --git a/index.js b/index.js index 6279d18..ba0a840 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,8 @@ -const Raven = require('raven') -Raven.config(process.env.SENTRY_DSN).install() +if (process.env.SENTRY_DSN) { + const Raven = require('raven') + Raven.config(process.env.SENTRY_DSN).install() +} + const Yamburger = require('./lib/yamburger') module.exports = (robot) => { diff --git a/script/deploy b/script/deploy deleted file mode 100755 index 0185cfa..0000000 --- a/script/deploy +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -ex - -now -E --npm --public -now alias -now rm YAMBURGER --safe -y