Compare commits
6 Commits
5994623914
...
feature/do
Author | SHA1 | Date | |
---|---|---|---|
436ba4a36b | |||
6e802434db | |||
ed1d993343 | |||
f90798a363 | |||
71b8b5d9f9 | |||
31738706e3 |
27
.gitea/workflows/build.yaml
Normal file
27
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
name: Role Wizard discord bot build and push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
discord-bot-build:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
steps:
|
||||||
|
- name: Build
|
||||||
|
run: npm run dockerBuild
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: gitea.amundsson.eu
|
||||||
|
username: namundsson@gmail.com
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
run: |
|
||||||
|
docker build -t gitea.amundsson.eu/n1jos/role-wizard-discord-bot:latest .
|
||||||
|
docker push gitea.amundsson.eu/n1jos/role-wizard-discord-bot:latest
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM node:22
|
||||||
|
COPY build/ /home/node/app
|
||||||
|
ENTRYPOINT ["node", "build/index.js"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FROM node:22 as builder
|
||||||
|
COPY . /src/
|
||||||
|
WORKDIR /src/
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
RUN cp package.json ./build/package.json
|
||||||
|
RUN cp package-lock.json ./build/package-lock.json
|
||||||
|
RUN cd build && npm ci --production
|
||||||
|
RUN rm package.json && rm package-lock.json
|
||||||
|
|
||||||
|
FROM node:22 as runner
|
||||||
|
|
||||||
|
COPY --from=builder /src/build/ /home/node/app
|
||||||
|
ENTRYPOINT [ "node", "/home/node/app/index.js" ]
|
11
package.json
11
package.json
@ -6,9 +6,11 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf build",
|
"clean": "rm -rf build",
|
||||||
"build": "tsc --build",
|
"build": "tsc --build",
|
||||||
"register": "npx ts-node src/register-commands.ts",
|
"registerCommands": "npx ts-node src/register-commands.ts",
|
||||||
"start": "yarn run clean && yarn run build && yarn run register && node build/index.js",
|
"start": "yarn clean && yarn build && yarn registerCommands && yarn runBot",
|
||||||
"startNoClean": "yarn run build && node build/index.js"
|
"startNoClean": "yarn build && yarn runBot",
|
||||||
|
"dockerBuild": "npm run clean && npm run build && yarn run registerCommands",
|
||||||
|
"runBot": "node build/index.js"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
@ -16,5 +18,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^14.14.1",
|
"discord.js": "^14.14.1",
|
||||||
"dotenv": "^16.4.5"
|
"dotenv": "^16.4.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"typescript": "^5.4.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user