Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ci

on:
push:
branches:
- 'master'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: r-webdev
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/r-webdev/support-bot:stable,ghcr.io/r-webdev/support-bot:latest
17 changes: 0 additions & 17 deletions .github/workflows/deploy.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache npm dependencies
uses: actions/cache@v3
env:
cache-name: cache-npm
with:
path: node_modules
key: ${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
${{ env.cache-name }}-

- name: Install dependencies
run: yarn install --frozen-lockfile

# These are temporarily allowed to fail.
# "Temporarily"
- name: Lint
run: npm run lint
continue-on-error: true
- name: Test
run: npm run test
continue-on-error: true
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:16.18.1-alpine AS deps

WORKDIR /app

COPY package.json ./
COPY tsconfig.json ./
COPY yarn.lock ./
COPY src ./src

RUN yarn install --frozen-lockfile
RUN npm run build

FROM node:16.18.1-alpine

WORKDIR /app

ENV NODE_ENV=production

COPY package.json ./
COPY yarn.lock ./
RUN yarn install --frozen-lockfile && rm -rf /usr/local/share/.cache
COPY --from=deps /app/build .

CMD ["node","index.js"]
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"type": "module",
"engines": {
"node": "16.15.0"
"node": "16.18.1"
},
"scripts": {
"dev": "cross-env TS_NODE_FILES=true TS_NODE_PROJECT=\"./tsconfig.json\" nodemon -r dotenv/config -x node --experimental-specifier-resolution=node --loader ts-node/esm ./src/index.ts",
Expand Down