From 640e23b61ec9b9f90cd832b8f0844f68d7081ee0 Mon Sep 17 00:00:00 2001 From: Robbie Murray Date: Fri, 8 Dec 2023 09:44:34 +0000 Subject: [PATCH] Add workflow to validate Caddy config --- .github/workflows/validate-caddy.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/validate-caddy.yml diff --git a/.github/workflows/validate-caddy.yml b/.github/workflows/validate-caddy.yml new file mode 100644 index 00000000..55012ae6 --- /dev/null +++ b/.github/workflows/validate-caddy.yml @@ -0,0 +1,34 @@ +name: Validate Caddyfiles + +on: + push: + branches: [ main ] + paths: + - svcs/data/caddy/** + - .github/workflows/validate-caddy.yml + pull_request: + branches: [ main ] + paths: + - svcs/data/caddy/** + - .github/workflows/validate-caddy.yml + +jobs: + validate: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Caddy + run: | + curl -sSLo caddy.tar.gz "https://github.com/caddyserver/caddy/releases/download/v2.4.6/caddy_2.4.6_linux_amd64.tar.gz" + tar xzvf caddy.tar.gz caddy + sudo mv caddy /usr/local/bin/ + caddy version + + - name: Verify Caddyfile.blue + run: caddy validate --config ./svcs/data/caddy/Caddyfile.blue + + - name: Verify Caddyfile.green + run: caddy validate --config ./svcs/data/caddy/Caddyfile.green