diff --git a/.github/workflows/logical-backup.yml b/.github/workflows/logical-backup.yml index c4aeb1e..439c3b9 100644 --- a/.github/workflows/logical-backup.yml +++ b/.github/workflows/logical-backup.yml @@ -25,15 +25,18 @@ jobs: env: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done + echo "::set-output name=changed-files::$(echo "$ALL_CHANGED_FILES" | tr '\n' ',')" + - name: Convert output to array + id: convert-to-array + run: | + IFS=',' read -r -a CHANGED_FILES_ARRAY <<< "${{ steps.list-changed-files.outputs.changed-files }}" + echo "::set-output name=changed-files-array::${CHANGED_FILES_ARRAY[@]}" - name: Generate container metadata id: meta uses: docker/metadata-action@v5.5.1 with: - images: ghcr.io/obmondo/logical-backup + images: ghcr.io/obmondo/${{ steps.changed-files.outputs.all_changed_files}} tags: | type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }} type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} diff --git a/.github/workflows/mongodb-backup.yml b/.github/workflows/mongodb-backup.yml index 55869b5..a49cccb 100644 --- a/.github/workflows/mongodb-backup.yml +++ b/.github/workflows/mongodb-backup.yml @@ -2,7 +2,7 @@ name: Build mongodb backup on: push: - branches: [ "*" ] + branches: [ "-" ] paths: 'mongodb-backup/**' tags: [ "v*" ] diff --git a/logical-backup/Dockerfile b/logical-backup/Dockerfile index 7a40c93..a0cd427 100644 --- a/logical-backup/Dockerfile +++ b/logical-backup/Dockerfile @@ -39,4 +39,4 @@ COPY ./* ./ ENV PG_DIR=/usr/lib/postgresql -ENTRYPOINT ["/dump.sh"] +ENTRYPOINT ["/dump.sh"] \ No newline at end of file diff --git a/mongodb-backup/Dockerfile b/mongodb-backup/Dockerfile index 6d6637a..f273237 100644 --- a/mongodb-backup/Dockerfile +++ b/mongodb-backup/Dockerfile @@ -23,4 +23,3 @@ RUN chmod 775 /usr/local/bin/mongouri VOLUME /backup CMD /usr/local/bin/entrypoint -