name: Build and Deploy Blog on: push: branches: - master workflow_dispatch: jobs: build-and-deploy-local: runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v3 - name: Rebuild and Deploy with Docker Compose run: | # Use the host's Docker to build the image defined in docker-compose.yml # The '--no-cache' flag ensures it picks up any changes from your repository # The 'up -d' command will recreate only the services that have changed docker-compose up -d --build --no-cache # Clean up any old, unused images to save disk space docker image prune -f