kind: pipeline # Defines this as a Woodpecker CI pipeline. type: docker # Specifies that this pipeline will execute commands using Docker. name: restart-discord-bot # A descriptive name for your pipeline. # Defines when this pipeline should be triggered. trigger: branch: - main # This pipeline will only run when changes are pushed to the 'main' branch. event: - push # The pipeline is triggered specifically by a 'push' event. steps: - name: restart-bot # Name of this specific step in the pipeline. image: docker:latest # Uses the official Docker image, which includes the Docker CLI. # This volume mount allows the Docker CLI inside the Woodpecker agent container # to communicate with the Docker daemon on the host machine. This is crucial # for being able to restart containers running on the host. volumes: - name: docker_sock path: /var/run/docker.sock commands: # The command to restart your Discord bot container. # IMPORTANT: Replace 'YOUR_DISCORD_BOT_CONTAINER_NAME' with the actual name # of your Discord bot's Docker container. # You can find the container name using 'docker ps' on your server. - docker restart YOUR_DISCORD_BOT_CONTAINER_NAME # Defines the volumes that are available to the steps in this pipeline. volumes: - name: docker_sock # A named volume. host: path: /var/run/docker.sock # Maps the Docker socket from the host into the container.