add docker build files

This commit is contained in:
spiral 2022-02-01 09:12:55 -05:00
parent dffb46f623
commit 62705ef20d
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
3 changed files with 46 additions and 0 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
node_modules/

34
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Docker build
on:
push:
branches: [ main ]
jobs:
image:
name: Build Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/apparyllisorg/spot:${{ github.sha }}
ghcr.io/apparyllisorg/spot:latest
labels: ${{ steps.meta.outputs.labels }}

11
Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM alpine:latest
RUN apk add nodejs-current yarn
WORKDIR /app
COPY package.json yarn.lock /app/
RUN yarn
COPY . /app
CMD ["node", "bot.js"]