diff --git a/.github/workflows/build-gazebo-world-ws.yaml b/.github/workflows/build-gazebo-world-ws.yaml index a83c344c..d83e54cd 100644 --- a/.github/workflows/build-gazebo-world-ws.yaml +++ b/.github/workflows/build-gazebo-world-ws.yaml @@ -1,21 +1,38 @@ name: Build Docker Image for gazebo-world-ws on: - push: - branches: - - "main" - tags: - - v* - paths: - - .github/workflows/build-gazebo-world-ws.yaml - - gazebo_world_ws/docker/Dockerfile - - gazebo_world_ws/docker/.dockerignore - - gazebo_world_ws/docker/.bashrc + workflow_run: + workflows: [Build Docker Image for template-ws] + types: + - completed jobs: - docker: + paths-filter: if: github.repository == 'j3soon/ros2-essentials' runs-on: ubuntu-latest + outputs: + output1: ${{ steps.filter.outputs.workflows }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + workflows: + - .github/workflows/build-gazebo-world-ws.yaml + - gazebo_world_ws/docker/Dockerfile + - gazebo_world_ws/docker/.dockerignore + - gazebo_world_ws/docker/.bashrc + - name: Changes matched + if: steps.filter.outputs.workflows == 'true' + run: echo "Changes matched, will build image" + - name: Changes didn't match + if: steps.filter.outputs.workflows != 'true' + run: echo "Changes didn't match, will NOT build image" + docker: + needs: paths-filter + if: ${{ needs.paths-filter.outputs.workflows == 'true' }} + runs-on: ubuntu-latest steps: - name: Maximize build space uses: easimon/maximize-build-space@master diff --git a/.github/workflows/build-template-ws.yaml b/.github/workflows/build-template-ws.yaml index bc6963a1..5097b323 100644 --- a/.github/workflows/build-template-ws.yaml +++ b/.github/workflows/build-template-ws.yaml @@ -4,18 +4,37 @@ on: push: branches: - "main" + - "ci/reuse-docker-cache" tags: - v* - paths: - - .github/workflows/build-template-ws.yaml - - template_ws/docker/Dockerfile - - template_ws/docker/.dockerignore - - template_ws/docker/.bashrc jobs: - docker: + paths-filter: if: github.repository == 'j3soon/ros2-essentials' runs-on: ubuntu-latest + outputs: + output1: ${{ steps.filter.outputs.workflows }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + workflows: + - .github/workflows/build-template-ws.yaml + - template_ws/docker/Dockerfile + - template_ws/docker/.dockerignore + - template_ws/docker/.bashrc + - name: Changes matched + if: steps.filter.outputs.workflows == 'true' + run: echo "Changes matched, will build image" + - name: Changes didn't match + if: steps.filter.outputs.workflows != 'true' + run: echo "Changes didn't match, will NOT build image" + docker: + needs: paths-filter + if: ${{ needs.paths-filter.outputs.workflows == 'true' }} + runs-on: ubuntu-latest steps: - name: Maximize build space uses: easimon/maximize-build-space@master