nyanimedb/.forgejo/workflows/build-and-deploy.yml
nihonium 1fdb82ed0d
All checks were successful
Build and Deploy Go App / build (push) Successful in 2m44s
Build and Deploy Go App / deploy (push) Has been skipped
fix: removed upload
2025-10-08 02:34:53 +03:00

37 lines
842 B
YAML

name: Build and Deploy Go App
on:
push:
branches:
- master
pull_request:
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
if: ${{ github.event.inputs.deploy == 'true' }} # manual deploy trigger
steps:
- name: Deploy container locally
run: |
echo "Deploying nyanimedb locally..."
docker stop nyanimedb || true
docker rm nyanimedb || true
docker run -d --name nyanimedb -p 8080:8080 nyanimedb:latest