Some checks failed
Deploy to NAS / deploy (push) Failing after 26s
- Public feed (/) with infinite scroll via Intersection Observer - Self-registration (/register) - Admin area (/admin/entries, /admin/users) with user management - journal_entries: visibility (public/private) + hashtags fields - users: is_admin flag - DB schema updated (recreate DB to apply) - CI: run go test via docker run (golang:1.25-alpine) — fixes 'go not found' Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
name: Deploy to NAS
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: self-hosted
|
|
container:
|
|
image: docker:latest
|
|
options: -v /volume2/docker:/volume2/docker
|
|
|
|
steps:
|
|
- name: Pull code
|
|
run: |
|
|
if [ -d "${{ vars.DEPLOY_DIR }}/.git" ]; then
|
|
git -C ${{ vars.DEPLOY_DIR }} pull
|
|
else
|
|
git clone http://192.168.1.4:3000/christoph/pamietnik.git ${{ vars.DEPLOY_DIR }}
|
|
fi
|
|
|
|
- name: Write .env
|
|
run: printf 'DB_PASSWORD=%s\n' '${{ secrets.DB_PASSWORD }}' > ${{ vars.DEPLOY_DIR }}/.env
|
|
|
|
- name: Test
|
|
run: |
|
|
docker run --rm \
|
|
-v ${{ vars.DEPLOY_DIR }}/backend:/app \
|
|
-w /app \
|
|
golang:1.25-alpine \
|
|
go test ./...
|
|
|
|
- name: Build & Deploy
|
|
run: docker compose -f ${{ vars.DEPLOY_DIR }}/docker-compose.yml up --build -d
|
|
|
|
- name: Health check
|
|
run: |
|
|
sleep 15
|
|
wget -qO- http://192.168.1.4:9050/healthz || exit 1
|