dsec-discord-bot/.github/workflows/deploy.yml
2025-11-11 22:38:41 +11:00

28 lines
907 B
YAML

name: Docker Compose Deploy
on:
push:
branches:
- main # Trigger this workflow on pushes to the main branch
jobs:
build_and_deploy:
runs-on: [self-hosted, linux] # Use the labels you assigned to your self-hosted runner
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build and deploy with Docker Compose
run: |
echo "Starting Docker Compose with --build and --force-recreate..."
cd ~/dsec_bot
sudo docker-compose up -d --build --force-recreate
echo "Deployment complete."
# Optional: Clean up old Docker images to save disk space
- name: Clean up old Docker images
run: |
echo "Cleaning up dangling Docker images..."
sudo docker image prune -f