updates #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to DigitalOcean | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| deploy: | |
| name: Deploy to Production | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Deploy to DigitalOcean | |
| uses: appleboy/ssh-action@v1.0.0 | |
| with: | |
| host: ${{ secrets.DO_HOST }} | |
| username: ${{ secrets.DO_USERNAME }} | |
| key: ${{ secrets.DO_SSH_KEY }} | |
| script: | | |
| cd /root/arxiv2md | |
| git fetch origin | |
| git reset --hard origin/main | |
| docker-compose down | |
| docker-compose build --no-cache | |
| docker-compose up -d --force-recreate | |
| sleep 5 | |
| curl -f http://localhost:8001/health || exit 1 | |
| docker-compose logs --tail=50 | |
| - name: Notify deployment status | |
| if: always() | |
| run: | | |
| if [ ${{ job.status }} == 'success' ]; then | |
| echo "✅ Deployment successful!" | |
| else | |
| echo "❌ Deployment failed!" | |
| fi |