Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy for dev

on:
push:
branches: ["dev_go"]
branches: ["dev"]

env:
REGISTRY: ghcr.io
Expand All @@ -19,9 +19,6 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
ref: "dev_go"

- name: Login DockerHub
uses: docker/login-action@v2
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/prod_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy for production

on:
push:
branches: ["v2"]
branches: ["main"]

env:
REGISTRY: ghcr.io
Expand All @@ -19,9 +19,6 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
ref: "v2"

- name: Login DockerHub
uses: docker/login-action@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"gomail",
"gonic",
"hackintosh",
"huma",
"humagin",
"Infof",
"jmoiron",
"joho",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM golang as builder
COPY . /app
WORKDIR /app
# RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o saturday .
RUN go env -w CGO_ENABLED=0 &&\
go build -v -o saturday .

Expand All @@ -12,6 +11,7 @@ RUN apk add --no-cache tzdata &&\

WORKDIR /app
COPY --from=builder /app/saturday /app
COPY --from=builder /app/migrations /app/migrations

ENV Port=80

Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"
services:
server:
image: ghcr.io/nbtca/saturday
ports:
- 80:80
volumes:
- ./logs/:/app/logs/
environment:
DB_URL: root:password@(host.docker.internal:3306)/saturday_dev?parseTime=True
PORT: 80
extra_hosts:
- "host.docker.internal:host-gateway"

23 changes: 18 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
module github.com/nbtca/saturday

go 1.17
go 1.21

toolchain go1.22.2

require (
github.com/Masterminds/squirrel v1.5.4
github.com/MicahParks/keyfunc v1.9.0
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
github.com/danielgtaylor/huma/v2 v2.18.0
github.com/gin-contrib/cors v1.5.0
github.com/gin-gonic/gin v1.9.1
github.com/go-playground/validator/v10 v10.18.0
github.com/go-sql-driver/mysql v1.7.1
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/jmoiron/sqlx v1.3.5
github.com/joho/godotenv v1.5.1
github.com/lib/pq v1.10.9
github.com/nsqio/go-nsq v1.1.0
github.com/ory/dockertest/v3 v3.10.0
github.com/qustavo/sqlhooks/v2 v2.1.0
Expand All @@ -21,15 +25,23 @@ require (

require (
dario.cat/mergo v1.0.0 // indirect
github.com/bytedance/sonic v1.10.2 // indirect
github.com/bytedance/sonic v1.11.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/kr/text v0.1.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/tools v0.18.0 // indirect
Expand All @@ -52,6 +64,7 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-migrate/migrate/v4 v4.17.1
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
Expand Down
217 changes: 51 additions & 166 deletions go.sum

Large diffs are not rendered by default.

Empty file added migrations/000001_init.down.sql
Empty file.
Loading
Loading