Some checks failed
Deploy to NAS / deploy (push) Failing after 3m0s
Bind-mounted source causes Go module resolution issues in the runner container. Tests now run as a Dockerfile layer (after go mod download, before SPA inject + go build) — no bind mount, no extra step needed. A failed test aborts the build and the deploy never happens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 lines
960 B
YAML
35 lines
960 B
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 }} fetch origin main
|
|
git -C ${{ vars.DEPLOY_DIR }} reset --hard origin/main
|
|
git -C ${{ vars.DEPLOY_DIR }} clean -fd
|
|
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: 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
|