name: 🚀 Deploy to Dokploy on: push: branches: [ main ] pull_request: branches: [ main ] workflow_dispatch: jobs: pre-deploy-checks: runs-on: ubuntu-latest name: 🔍 Pre-deployment validation steps: - uses: actions/checkout@v4 - name: Set up Python 3.11 uses: actions/setup-python@v4 with: python-version: '3.11' - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '18' - name: Cache Python dependencies uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('requirements/production.txt') }} - name: Install Python dependencies run: | python -m pip install --upgrade pip pip install -r requirements/production.txt - name: Install and build Tailwind CSS run: | cd theme/static_src npm install npm run build - name: Run Django system checks run: | export DJANGO_SETTINGS_MODULE=django_project.settings.production export SECRET_KEY=github-actions-secret-key export ALLOWED_HOSTS=localhost export DEBUG=False python manage.py check --deploy - name: Test static file collection run: | export DJANGO_SETTINGS_MODULE=django_project.settings.build python manage.py collectstatic --noinput --dry-run - name: Check for pending migrations run: | export DJANGO_SETTINGS_MODULE=django_project.settings.production export SECRET_KEY=github-actions-secret-key export DATABASE_URL=sqlite:///temp.db python manage.py makemigrations --check --dry-run - name: Test Docker build run: | docker build --target production -t django-template-test . docker rmi django-template-test deploy: runs-on: ubuntu-latest name: 📤 Deploy notification needs: pre-deploy-checks if: github.ref == 'refs/heads/main' && github.event_name == 'push' steps: - name: ✅ Pre-deployment checks passed run: | echo "🎉 All pre-deployment checks passed!" echo "🚀 Ready for deployment to Dokploy" echo "📋 Manual steps required:" echo " 1. Trigger deployment in Dokploy dashboard" echo " 2. Wait for build completion" echo " 3. Run post-deployment verification" - name: 📝 Deployment reminder if: success() run: | echo "::notice::Deployment ready! Trigger deployment in Dokploy manually"