Some checks failed
Deploy to NAS / deploy (push) Failing after 5s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
763 B
YAML
30 lines
763 B
YAML
name: Deploy to NAS
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- name: Pull code
|
|
run: |
|
|
if [ -d "${{ secrets.DEPLOY_DIR }}/.git" ]; then
|
|
git -C ${{ secrets.DEPLOY_DIR }} pull
|
|
else
|
|
git clone http://192.168.1.4:3000/christoph/pamietnik.git ${{ secrets.DEPLOY_DIR }}
|
|
fi
|
|
|
|
- name: Write .env
|
|
run: printf 'DB_PASSWORD=%s\n' '${{ secrets.DB_PASSWORD }}' > ${{ secrets.DEPLOY_DIR }}/.env
|
|
|
|
- name: Build & Deploy
|
|
run: /usr/local/bin/docker compose -f ${{ secrets.DEPLOY_DIR }}/docker-compose.yml up --build -d
|
|
|
|
- name: Health check
|
|
run: |
|
|
sleep 15
|
|
curl -sf http://localhost:9050/healthz || exit 1
|