Skip to content

Commit

Permalink
feat: Added BOT_TOKEN to Build arg
Browse files Browse the repository at this point in the history
  • Loading branch information
bmonish committed Apr 7, 2024
1 parent 32884c6 commit 4cf4a23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
Expand Down
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,4 @@ client.on("interactionCreate", async (interaction) => {
}
});

client.login(
"MTIyNjUzMDUxMzM4NTQyNzEwNQ.GUbaSW.T29CVbbog_AGJcCrKT2SW1yiTwXjmmHGicXd9Q"
);
client.login(process.env.BOT_TOKEN);

0 comments on commit 4cf4a23

Please sign in to comment.