Skip to content

Commit 56f4189

Browse files
committed
init a new test backend
1 parent 8fa4f02 commit 56f4189

15 files changed

+1511
-5
lines changed

.github/workflows/docker.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docker
2+
on:
3+
push:
4+
branches: ['main', 'new-backend']
5+
tags: ['v*.*.*']
6+
pull_request:
7+
branches: ['main']
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
22+
- name: Log into registry ${{ env.REGISTRY }}
23+
if: github.event_name != 'pull_request'
24+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Extract Docker metadata
30+
id: meta
31+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
32+
with:
33+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34+
- name: Build and push Docker image
35+
id: build-and-push
36+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
37+
with:
38+
context: service
39+
platforms: linux/amd64,linux/arm64
40+
push: ${{ github.event_name != 'pull_request' }}
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}
43+
cache-from: type=gha
44+
cache-to: type=gha,mode=max

.nvmrc

-1
This file was deleted.

.tool-versions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 22.14.0

pnpm-lock.yaml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

service/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM node:22-alpine
2+
WORKDIR /app
3+
COPY package.json pnpm-lock.yaml ./
4+
RUN corepack enable && pnpm install --frozen-lockfile
5+
COPY . .
6+
ENV NODE_ENV=production
7+
CMD ["pnpm", "start"]
8+
EXPOSE 29691

service/package.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "@dtinth/automatron-service",
3+
"private": true,
4+
"description": "Personal assistant",
5+
"version": "2.0.0",
6+
"repository": "https://github.com/dtinth/automatron",
7+
"dependencies": {
8+
"@azure/data-tables": "^13.3.0",
9+
"@azure/identity": "^4.8.0",
10+
"@elysiajs/node": "^1.2.6",
11+
"@line/bot-sdk": "^9.2.2",
12+
"age-encryption": "^0.2.1",
13+
"async-cache-dedupe": "^2.2.0",
14+
"consola": "^3.4.2",
15+
"elysia": "^1.2.25",
16+
"ofetch": "^1.4.1",
17+
"unstorage": "^1.15.0",
18+
"ws": "^8.18.0"
19+
},
20+
"devDependencies": {
21+
"@tsconfig/node22": "^22.0.1",
22+
"@types/node": "^22.14.0",
23+
"@types/yargs": "^17.0.33",
24+
"typescript": "^5.8.2",
25+
"yaml": "^2.7.1",
26+
"yargs": "^17.7.2"
27+
},
28+
"type": "module",
29+
"scripts": {
30+
"dev": "node --experimental-transform-types --env-file=.env --watch src/main.ts",
31+
"start": "node --experimental-transform-types --env-file=.env src/main.ts",
32+
"node": "node --experimental-transform-types --env-file=.env"
33+
}
34+
}

0 commit comments

Comments
 (0)