mirror of
https://github.com/insomniafi/insomniaid-bot.git
synced 2024-11-21 15:00:19 +00:00
Initial Commit
This commit is contained in:
commit
a013466077
19
.github/dependabot.yml
vendored
Normal file
19
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
# GitHub Actions
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
target-branch: "develop"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
|
||||||
|
# npm
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
target-branch: "develop"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
13
.github/labeler.yml
vendored
Normal file
13
.github/labeler.yml
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
dependencies:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- package-lock.json
|
||||||
|
|
||||||
|
documentation:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- README.md
|
||||||
|
- SECURITY.md
|
||||||
|
- CONTRIBUTING.md
|
||||||
|
- LICENSE
|
||||||
|
- .env_example
|
20
.github/workflows/dependabot_auto-merge.yml
vendored
Normal file
20
.github/workflows/dependabot_auto-merge.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: Dependabot Auto-Merge
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
branches: [ develop ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dependabot:
|
||||||
|
name: Dependabot Auto-Merge
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||||
|
steps:
|
||||||
|
- name: Enable auto-merge for Dependabot PRs
|
||||||
|
run: gh pr merge --auto --merge "$PR_URL"
|
||||||
|
env:
|
||||||
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
22
.github/workflows/docker-build.yml
vendored
Normal file
22
.github/workflows/docker-build.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Docker Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, assigned, edited, ready_for_review]
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
buildx:
|
||||||
|
name: Docker Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3.7.1
|
||||||
|
id: buildx
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
- name: Build
|
||||||
|
run: docker build . # will run buildx
|
17
.github/workflows/labeler.yml
vendored
Normal file
17
.github/workflows/labeler.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
name: Labeler
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
label:
|
||||||
|
name: Labeler
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/labeler@v5
|
||||||
|
with:
|
||||||
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
sync-labels: true
|
22
.github/workflows/typescript-build.yml
vendored
Normal file
22
.github/workflows/typescript-build.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: TypeScript Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, assigned, edited, ready_for_review]
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tsc:
|
||||||
|
name: TypeScript Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: install node v22
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
- name: npm install
|
||||||
|
run: npm install
|
||||||
|
- name: tsc
|
||||||
|
uses: icrawl/action-tsc@v1
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
.env
|
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
|
"files.insertFinalNewline": true,
|
||||||
|
"files.trimFinalNewlines": true,
|
||||||
|
"editor.renderFinalNewline": false
|
||||||
|
}
|
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM docker.io/node:22-alpine
|
||||||
|
|
||||||
|
#Dependencies
|
||||||
|
RUN apk add --virtual .build-deps python3 make g++ gcc git
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
COPY / /usr/src/app/
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
CMD [ "npm", "start" ]
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2024 Verkkopeliyhdistys Insomnia ry & Warén Group
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
20
README.md
Normal file
20
README.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Insomnia ID - Bot
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Verkkopeliyhdistys Insomnia ry - Identity Bot
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
### Build Image
|
||||||
|
|
||||||
|
`podman build -t ghcr.io/insomniafi/insid-bot`
|
||||||
|
|
||||||
|
### Publish Image
|
||||||
|
`podman push ghcr.io/insomniafi/insid-bot`
|
||||||
|
|
||||||
|
### Run Container
|
||||||
|
|
||||||
|
`podman run --name insid-bot -d -e DISCORD_TOKEN= ghcr.io/insomniafi/insid-bot`
|
||||||
|
|
||||||
|
### Update Dependencies
|
||||||
|
`podman run --name insid-bot -d -e DISCORD_TOKEN= -v "$PWD":/usr/src/app/ ghcr.io/insomniafi/insid-bot`
|
26
package.json
Normal file
26
package.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "insid-bot",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "Verkkopeliyhdistys Insomnia ry - Identity Bot",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "rimraf ./build && tsc",
|
||||||
|
"start": "node --no-warnings build/index.js",
|
||||||
|
"start:dev": "rimraf ./build && tsc && node --no-warnings build/index.js"
|
||||||
|
},
|
||||||
|
"author": "Christer Warén / Warén Group",
|
||||||
|
"license": "MIT",
|
||||||
|
"private": true,
|
||||||
|
"homepage": "https://insomnia.fi",
|
||||||
|
"dependencies": {
|
||||||
|
"discord.js": "^14.16.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"rimraf": "^6.0.1",
|
||||||
|
"typescript": "^5.6.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=22.0.0",
|
||||||
|
"npm": ">=10.0.0"
|
||||||
|
}
|
||||||
|
}
|
16
tsconfig.json
Normal file
16
tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2020",
|
||||||
|
"module": "commonjs",
|
||||||
|
"lib": ["esnext"],
|
||||||
|
"allowJs": true,
|
||||||
|
"outDir": "build",
|
||||||
|
"rootDir": "src",
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true
|
||||||
|
},
|
||||||
|
"exclude": ["build", "node_modules", "datastore"]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user