Compare commits

...

20 commits

Author SHA1 Message Date
8dc085c6a0
feat: migrate nyanimedb image to new registry
All checks were successful
Build and Deploy Go App / build (push) Successful in 4m58s
Build and Deploy Go App / deploy (push) Successful in 2m37s
2025-10-08 20:57:36 +03:00
67ea56ec5d
feat: added buildx.sh 2025-10-08 20:56:48 +03:00
0cd058ccbb
fix: docker build context
Some checks failed
Build and Deploy Go App / build (push) Has been cancelled
Build and Deploy Go App / deploy (push) Has been cancelled
2025-10-08 19:39:25 +03:00
1784187e64
fix: server Dockerfile app path
Some checks failed
Build and Deploy Go App / build (push) Failing after 9m56s
Build and Deploy Go App / deploy (push) Has been skipped
2025-10-08 19:25:25 +03:00
f13b5e2237
fix: disable check-latest 2025-10-08 19:19:12 +03:00
9204e8e196
fix: server Dockerfile templates path
Some checks failed
Build and Deploy Go App / build (push) Failing after 10m46s
Build and Deploy Go App / deploy (push) Has been skipped
2025-10-08 19:16:10 +03:00
f3e65eb64e
fix: checkout code firstly
Some checks failed
Build and Deploy Go App / build (push) Failing after 10m47s
Build and Deploy Go App / deploy (push) Has been skipped
2025-10-08 19:06:33 +03:00
1fec76d6bc
fix: add check-latest: true
Some checks failed
Build and Deploy Go App / deploy (push) Has been cancelled
Build and Deploy Go App / build (push) Has been cancelled
2025-10-08 19:04:53 +03:00
ad9e7f95cb
fix: add caching
Some checks failed
Build and Deploy Go App / build (push) Has been cancelled
Build and Deploy Go App / deploy (push) Has been cancelled
2025-10-08 19:02:13 +03:00
25aa5fd880 fix: docker build
Some checks failed
Build and Deploy Go App / build (push) Has been cancelled
Build and Deploy Go App / deploy (push) Has been cancelled
2025-10-08 18:50:40 +03:00
1a01baffb3 fix: server dockerfile 2025-10-08 18:50:05 +03:00
f26a1096a1 feat: Dockerfiles for components 2025-10-08 18:48:53 +03:00
bf599c58c3
fix: init docker
Some checks failed
Build and Deploy Go App / deploy (push) Has been cancelled
Build and Deploy Go App / build (push) Has been cancelled
2025-10-08 18:09:47 +03:00
6bf6aa31e8
feat: build and push to local registry
Some checks failed
Build and Deploy Go App / build (push) Failing after 6m45s
Build and Deploy Go App / deploy (push) Has been skipped
2025-10-08 17:50:28 +03:00
49ba6b4687
fix: downgrade upload-artifact to v3
Some checks failed
Build and Deploy Go App / build (push) Has been cancelled
Build and Deploy Go App / deploy (push) Has been cancelled
2025-10-08 17:39:18 +03:00
c120a9edb8
fix: artifact path
Some checks failed
Build and Deploy Go App / build (push) Failing after 6m4s
Build and Deploy Go App / deploy (push) Has been skipped
2025-10-08 17:31:46 +03:00
01d7683aed
feat: test upload artifact
Some checks failed
Build and Deploy Go App / build (push) Failing after 7m22s
Build and Deploy Go App / deploy (push) Has been skipped
2025-10-08 17:25:15 +03:00
fcaa7dff04
feat: run pipeline on ubuntu-latest
Some checks failed
Build and Deploy Go App / build (push) Failing after 2m58s
Build and Deploy Go App / deploy (push) Has been skipped
2025-10-08 17:13:10 +03:00
6ed7e2fcf1
feat: run pipeline for cicd branch
Some checks are pending
Build and Deploy Go App / build (push) Waiting to run
Build and Deploy Go App / deploy (push) Blocked by required conditions
2025-10-08 17:11:02 +03:00
e6f89eeee1
feat: test container build 2025-10-08 17:10:07 +03:00
6 changed files with 121 additions and 53 deletions

View file

@ -1,45 +1,74 @@
name: Build and Deploy Go App
on:
push:
branches:
- master
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Go app
run: |
cd modules/server
go mod tidy
go build -o nyanimedb .
- name: Build Docker image
run: |
cd modules/server
docker build -t nyanimedb:latest .
deploy:
runs-on: self-hosted
needs: build
env:
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: nyanimedb
POSTGRES_PORT: 5432
POSTGRES_VERSION: 18
LOG_LEVEL: ${{ vars.LOG_LEVEL }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy containers locally
run: |
cd deploy
docker compose down || true
docker compose up -d
name: Build and Deploy Go App
on:
push:
branches:
- master
- cicd
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-go@v6
with:
go-version: '^1.25'
check-latest: false
cache-dependency-path: |
modules/server/go.sum
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Build application
- name: Build Go app
run: |
cd modules/server
go mod tidy
go build -o nyanimedb .
- name: Upload built application to artifactory
uses: actions/upload-artifact@v3
with:
name: nyanimedb
path: modules/server/nyanimedb
# Build Docker image
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./modules/server
file: Dockerfiles/Dockerfile_server
push: true
tags: meowgit.nekoea.red/nihonium/nyanimedb:latest
deploy:
runs-on: self-hosted
needs: build
env:
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: nyanimedb
POSTGRES_PORT: 5432
POSTGRES_VERSION: 18
LOG_LEVEL: ${{ vars.LOG_LEVEL }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy containers locally
run: |
cd deploy
docker compose down || true
docker compose up -d

View file

@ -0,0 +1,24 @@
FROM node:20-bookworm
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release \
sudo \
software-properties-common && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update && \
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,20 @@
FROM ubuntu:22.04
WORKDIR /app
COPY --chmod=755 nyanimedb /app
COPY templates /app/templates
EXPOSE 8080
ENTRYPOINT ["/app/nyanimedb"]
# FROM golang:1.25 AS builder
# ARG VERSION=dev
# WORKDIR /go/src/app
# COPY main.go .
# RUN go build -o main -ldflags=-X=main.version=${VERSION} main.go
# FROM debian:buster-slim
# COPY --from=builder /go/src/app/main /go/bin/main
# ENV PATH="/go/bin:${PATH}"
# CMD ["main"]

2
deploy/buildx.sh Normal file
View file

@ -0,0 +1,2 @@
#!/bin/bash
docker buildx build --platform linux/amd64 -t meowgit.nekoea.red/nihonium/forgejo-runner:latest -f ./Dockerfiles/Dockerfile_forgejo-runner . --push

View file

@ -27,7 +27,7 @@ services:
# - pgadmin_data:/var/lib/pgadmin
nyanimedb:
image: nyanimedb:latest
image: meowgit.nekoea.red/nihonium/nyanimedb:latest
container_name: nyanimedb
restart: always
environment:

View file

@ -1,7 +0,0 @@
FROM ubuntu:22.04
WORKDIR /app
COPY --chmod=755 nyanimedb /app
COPY templates /app/templates
EXPOSE 8080
ENTRYPOINT ["/app/nyanimedb"]