From 9091f38dea47067aa3c007d4d7461446f13ee913 Mon Sep 17 00:00:00 2001 From: LRVT <21357789+l4rm4nd@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:04:41 +0100 Subject: [PATCH] Create validator.yml GitHub Action to validate docker-compoye.yml files --- .github/workflows/validator.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/validator.yml diff --git a/.github/workflows/validator.yml b/.github/workflows/validator.yml new file mode 100644 index 0000000..f602129 --- /dev/null +++ b/.github/workflows/validator.yml @@ -0,0 +1,26 @@ +name: CI +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + validateComposeSyntax: + runs-on: ubuntu-latest + #continue-on-error: true + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + # Loops over all compose files and uses docker compose check for YML validation + - name: DockerComposeCheck + run: | + for f in $(find ${PWD}/examples -name '*docker-compose*.yml'); \ + do \ + readlink -f $f && \ + docker compose -f $(readlink -f $f) config; \ + done + if: always()