From 6ee6788af833625484b18d76f771aad9408c542c Mon Sep 17 00:00:00 2001 From: GilbN <24592972+GilbN@users.noreply.github.com> Date: Mon, 12 Apr 2021 00:50:55 +0200 Subject: [PATCH] Create auto-build.yml Will this work? --- .github/workflows/auto-build.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/auto-build.yml diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml new file mode 100644 index 00000000..8bc5b72d --- /dev/null +++ b/.github/workflows/auto-build.yml @@ -0,0 +1,31 @@ +name: publishmultipledockerimages +on: + push: + branches: [ docker-mods ] + paths: + - '**/Dockerfile' + +jobs: + job1: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: get changed files + id: getfile + run: | + echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }}| xargs)" + + - name: echo the changed files + run: | + for i in ${{ steps.getfile.outputs.files }} + do + directory="$( echo $i | cut -d'/' -f1 -s )" + if [ -z "$directory" ]; then + continue # Skip root dir + elif [ "$i" == *.md ]; then + continue # Skip markdown files + docker build . --file $i --tag theme.park:$directory + done