Add Gitea Actions workflow for auto-deployment
Some checks failed
Deploy to Home Server / deploy (push) Has been cancelled
Some checks failed
Deploy to Home Server / deploy (push) Has been cancelled
- Deploy to /home/bini/project/collect-japan-news on push to main - Pull code, rebuild Docker container, and restart - Include health check after deployment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
33
.gitea/workflows/deploy.yml
Normal file
33
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Deploy to Home Server
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
DEPLOY_PATH: /home/bini/project/collect-japan-news
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Pull latest code
|
||||
run: |
|
||||
cd ${{ env.DEPLOY_PATH }}
|
||||
git pull origin main
|
||||
|
||||
- name: Rebuild and restart container
|
||||
run: |
|
||||
cd ${{ env.DEPLOY_PATH }}
|
||||
docker compose down
|
||||
docker compose build --no-cache
|
||||
docker compose up -d
|
||||
|
||||
- name: Cleanup old images
|
||||
run: docker image prune -f
|
||||
|
||||
- name: Health check
|
||||
run: |
|
||||
sleep 5
|
||||
curl -f http://localhost:8001 || exit 1
|
||||
Reference in New Issue
Block a user