name: Deploy Caddyfile to valhalla on: push: branches: [main] paths: - Caddyfile - .gitea/workflows/deploy-caddy.yml workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Push Caddyfile and reload Caddy run: | # Job containers do NOT inherit the runner's /config/caddy bind. # Docker-from-Docker with a host bind is the reliable path: the # volume source is resolved on valhalla, not inside the job container. # (Direct `cp /config/caddy/...` only works on the runner container # itself, which is not where this step runs.) apt-get update -qq && apt-get install -y -qq docker.io docker run --rm \ -v /config/caddy:/dest \ -v "$PWD/Caddyfile:/src/Caddyfile:ro" \ alpine:3.20 \ cp /src/Caddyfile /dest/Caddyfile docker exec caddy caddy reload --config /etc/caddy/Caddyfile