diff --git a/.github/workflows/docker-publish.yaml b/.github/workflows/docker-publish.yaml index 7bd840a..99a504a 100644 --- a/.github/workflows/docker-publish.yaml +++ b/.github/workflows/docker-publish.yaml @@ -18,7 +18,9 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image + env: + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} run: | - docker build . -t ghcr.io/bmonish/devtools-bot:latest -t ghcr.io/bmonish/devtools-bot:${{github.sha}} + docker build --build-arg BOT_TOKEN=$BOT_TOKEN . -t ghcr.io/bmonish/devtools-bot:latest -t ghcr.io/bmonish/devtools-bot:${{github.sha}} docker push ghcr.io/bmonish/devtools-bot:latest docker push ghcr.io/bmonish/devtools-bot:${{github.sha}} diff --git a/Dockerfile b/Dockerfile index f3e8525..94c16ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM node:20.11.1-alpine +ARG BOT_TOKEN +ENV BOT_TOKEN=$BOT_TOKEN + WORKDIR /usr/src/app COPY package.json . diff --git a/src/index.ts b/src/index.ts index d0f5bff..ecc1354 100644 --- a/src/index.ts +++ b/src/index.ts @@ -57,6 +57,4 @@ client.on("interactionCreate", async (interaction) => { } }); -client.login( - "MTIyNjUzMDUxMzM4NTQyNzEwNQ.GUbaSW.T29CVbbog_AGJcCrKT2SW1yiTwXjmmHGicXd9Q" -); +client.login(process.env.BOT_TOKEN);