Deploy Caddyfile Action is a GitHub action for deploying a Caddyfile to a remote server and restarting the Caddy Docker container.
.github/workflows/deploy.yml
on:
push:
paths:
- './files/Caddyfile'
jobs:
deploy:
name: Deploy Caddyfile
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v6
- name: Deploy Caddyfile
uses: ofkm/deploy-caddyfile@v1
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
username: ${{ secrets.SSH_USERNAME }}
source_file: ./Caddyfile
destination_folder: /etc/caddy/
container_name: caddy
chown_volumes: '["caddy-data", "caddy-etc"]'
chown_uid: '65532'
chown_gid: '65532'| Input | Description | Required | Default |
|---|---|---|---|
host |
SSH host address | Yes | |
port |
SSH port number | No | 22 |
key |
SSH private key | Yes | |
username |
SSH username | Yes | |
source_file |
Path to the Caddyfile to deploy | Yes | |
destination_folder |
Destination folder on the remote host | Yes | |
container_name |
Name of the Caddy docker container to restart | Yes | |
chown_volumes |
JSON-style array of Docker volume names to recursively chown |
No | [] |
chown_uid |
Numeric UID to apply to each volume listed in chown_volumes |
No* | |
chown_gid |
Numeric GID to apply to each volume listed in chown_volumes |
No* |
chown_uid and chown_gid are required when chown_volumes is non-empty. When set, the action uses a temporary Docker container on the remote host to run chown -R UID:GID against each named volume before restarting Caddy.