Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMasterK committed Oct 27, 2023
0 parents commit 69e60d7
Show file tree
Hide file tree
Showing 17 changed files with 5,811 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git/
node_modules/

.*

*.md
11 changes: 11 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-env node */
module.exports = {
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended-type-checked", "prettier"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
root: true,
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
};
38 changes: 38 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Multi-Architecture Build

on:
push:
paths-ignore:
- "**.md"
branches:
- main

jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 1337kavin/mastodon-piped-link-bot:latest
cache-from: type=gha
cache-to: type=gha,mode=max
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build, Test and Lint

on:
pull_request:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: "pnpm"
- run: pnpm install
- run: pnpm build
- run: pnpm lint
- run: pnpm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
pnpm-lock.yaml
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"singleQuote": false,
"trailingComma": "all",
"semi": true,
"tabWidth": 4,
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"printWidth": 120,
"vueIndentScriptAndStyle": false,
"quoteProps": "as-needed",
"arrowParens": "avoid"
}
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:lts-alpine AS build

WORKDIR /app/

RUN corepack enable && corepack prepare pnpm@latest --activate

COPY package.json pnpm-lock.yaml ./

RUN pnpm i

COPY . .

RUN pnpm build

CMD ["node", "dist/index.js"]
Loading

0 comments on commit 69e60d7

Please sign in to comment.