feat: add workflows

This commit is contained in:
Rogee
2024-12-15 10:02:52 +08:00
parent 77a3bd6af8
commit 0008831b24
5 changed files with 92 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
name: Build TGExporter
run-name: ${{ gitea.actor }} Build TGExporter
on: [push]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies and build frontend
run: |
cd frontend
npm config set registry https://npm.hub.ipao.vip
npm install
npm run build
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.22"
- name: Build Go application
run: |
mkdir -p build
go env -w GOPROXY=https://go.hub.ipao.vip,direct
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/app .
- name: Build final Docker image
run: |
docker login -u ${{ secrets.DOCKER_AF_USERNAME }} -p ${{ secrets.DOCKER_AF_PASSWORD }} docker-af.hub.ipao.vip
docker build --push -t docker-af.hub.ipao.vip/rogeecn/qvyun:latest .

11
Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM docker.hub.ipao.vip/alpine:3.20
COPY backend/build/app /app/qvyun
COPY backend/config.prod.toml /app/config.toml
COPY frontend/dist /app/dist
WORKDIR /app
ENTRYPOINT ["/app/qvyun"]
CMD [ "serve" ]

Binary file not shown.

39
backend/config.prod.toml Executable file
View File

@@ -0,0 +1,39 @@
[App]
Mode = "prod"
BaseURI = "https://qvyun.mp.jdwan.com"
[Http]
Port = 80
[Swagger]
BaseRoute = "doc"
Title = "Api"
Description = "Api Docs"
BasePath = "/v1"
Version = "1.0.0"
[Database]
Host = "10.1.1.3"
Database = "qvyun"
Password = "xixi0202"
[Wechat]
AppId = "wxf5bf0adeb99c2afd"
AppSecret = "3cf8fad4aa414f2b861399f111b22bb5"
Token = "W8Xhw5TivYBgY"
AesKey = "F6AqCxAV4W1eCrY6llJ2zapphKK49CQN3RgtPDrjhnI"
DevMode = false
[JWT]
ExpiresTime = "1680h"
SigningKey = "LiXi.Y@140202"
[HashIDs]
Salt = "LiXi.Y@140202"
[Storage]
Type = "local"
# Path = "/projects/mp-qvyun/backend/fixtures/processed"
Path = "/app/processed"
Asset = "/app/dist"

View File

@@ -1,5 +1,8 @@
{
"folders": [
{
"path": "."
},
{
"path": "frontend"
},
@@ -14,4 +17,4 @@
],
"git.ignoreLimitWarning": true
}
}
}