Merge pull request 'Add CI' (#2) from Midou36O/gothub:ci into master

Reviewed-on: https://codeberg.org/Odyssium/gothub/pulls/2
このコミットが含まれているのは:
Odyssium 2022-11-30 13:46:16 +00:00
コミット e35e825eb9
3個のファイルの変更45行の追加1行の削除

37
.woodpecker.yml ノーマルファイル
ファイルの表示

@ -0,0 +1,37 @@
pipeline:
build:
when:
event: [push, pull_request, tag]
image: golang:1.19.3-alpine
commands:
- go mod download
- go build .
dockerize:
when:
branch: [main, master]
event: [push]
image: plugins/docker
settings:
registry: codeberg.org
repo: codeberg.org/odyssium/gothub
username:
from_secret: user
password:
from_secret: passwd
# password = key or actual password
tags: latest
dockerize-dev:
when:
event: [push]
branch: [dev]
image: plugins/docker
settings:
registry: codeberg.org
repo: codeberg.org/odyssium/gothub
username:
from_secret: user
password:
from_secret: passwd
# password = key or actual password
tags: dev

7
Dockerfile ノーマルファイル
ファイルの表示

@ -0,0 +1,7 @@
FROM alpine:latest
WORKDIR /gothub
COPY ./gothub .
COPY ./public/ ./public/
COPY ./views/ ./views/
CMD ["/bin/sh", "-c", "./gothub"]
EXPOSE 3000

ファイルの表示

@ -36,7 +36,7 @@ func main() {
app := fiber.New(fiber.Config{ app := fiber.New(fiber.Config{
Views: engine, Views: engine,
Prefork: true, Prefork: false,
AppName: "GotHub", AppName: "GotHub",
// fucked up way to fix rate limits // fucked up way to fix rate limits
EnableTrustedProxyCheck: true, EnableTrustedProxyCheck: true,