From 940f2080560c60c187896becea4a47d4ce555e34 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Thu, 25 Feb 2021 11:36:48 -0600 Subject: [PATCH] Update Dockerfile with environment variables and add Docker CI Added Docker CI, updated README.md with more information on how to run the Docker container, and added CI (just testing it out) --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ Dockerfile | 2 +- README.md | 10 +++------- 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..c1b6c48 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build -t awscibo . --file Dockerfile --tag awscibo:$(date +%s) diff --git a/Dockerfile b/Dockerfile index a0ea9b6..b3d985e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ FROM node:latest RUN npm i -g awscibo -CMD ["awscibo", "yourbottokenhere"] +CMD awscibo $BOT_TOKEN diff --git a/README.md b/README.md index 44a0b1f..25dad8f 100644 --- a/README.md +++ b/README.md @@ -54,15 +54,11 @@ node awesomescibo.mjs ``` git clone https://github.com/ADawesomeguy/AwesomeSciBo.git ``` -2) Enter repo and edit bot token in Dockerfile -``` -cd AwesomeSciBo. -vim Dockerfile -``` -3) Build and run Docker image +2) Enter repo, build, and run Docker image ``` +cd AwesomeSciBo docker build -t awscibo . -docker run --name awscibo -d awscibo +docker run -e BOT_TOKEN=[your bot token here] --name awscibo -d awscibo ``` ## Usage To get started, run the command `do be helping` to get a list of commands. The more helpful commands will be the ones that generate packets, which are `do be roundgen pdf/html` and `do be roundgen pdf/html dm`.