From c734fc67405546c8191a79b42991d4d3a6e5a864 Mon Sep 17 00:00:00 2001 From: "k.koide" Date: Wed, 10 Jul 2024 11:02:57 +0900 Subject: [PATCH] push only gcc images --- .github/workflows/build.yml | 22 ++++++++++++++++++---- docker/ubuntu/Dockerfile.gcc | 3 ++- docker/ubuntu/Dockerfile.gcc.cuda | 3 ++- docker/ubuntu/Dockerfile.llvm | 3 ++- docker/ubuntu/Dockerfile.llvm.cuda | 3 ++- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d971c71..1ae6f134 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,17 +32,31 @@ jobs: - name: Docker login continue-on-error: true - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Docker build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: - tag: koide3/gtsam_points:${{ matrix.DISTRO.ubuntu }}.${{ matrix.DISTRO.suffix }} + tags: koide3/gtsam_points:${{ matrix.DISTRO.ubuntu }} file: ${{github.workspace}}/docker/ubuntu/Dockerfile.${{ matrix.DISTRO.suffix }} build-args: | BASE_IMAGE=koide3/gtsam_docker:${{ matrix.DISTRO.ubuntu }} context: . - push: ${{ github.event_name != 'push' }} + push: ${{ github.event_name == 'push' && contains(matrix.DISTRO.suffix, 'gcc') }} + + dispatch: + needs: build + strategy: + matrix: + repo: ['koide3/glim'] + runs-on: ubuntu-latest + steps: + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.PAT }} + repository: ${{ matrix.repo }} + event-type: trigger-event \ No newline at end of file diff --git a/docker/ubuntu/Dockerfile.gcc b/docker/ubuntu/Dockerfile.gcc index d959b260..8344643b 100644 --- a/docker/ubuntu/Dockerfile.gcc +++ b/docker/ubuntu/Dockerfile.gcc @@ -13,6 +13,7 @@ RUN cmake .. \ -DCMAKE_BUILD_TYPE=Release && \ make -j$(nproc) && \ make test && \ - make install + make install && \ + rm -rf /root/gtsam_points/build CMD ["bash"] diff --git a/docker/ubuntu/Dockerfile.gcc.cuda b/docker/ubuntu/Dockerfile.gcc.cuda index 90c4d7f5..c7d099e5 100644 --- a/docker/ubuntu/Dockerfile.gcc.cuda +++ b/docker/ubuntu/Dockerfile.gcc.cuda @@ -13,6 +13,7 @@ RUN cmake .. \ -DBUILD_WITH_CUDA_MULTIARCH=ON \ -DCMAKE_BUILD_TYPE=Release && \ make -j$(nproc) && \ - make install + make install && \ + rm -rf /root/gtsam_points/build CMD ["bash"] diff --git a/docker/ubuntu/Dockerfile.llvm b/docker/ubuntu/Dockerfile.llvm index 15f2836c..1c9a29d6 100644 --- a/docker/ubuntu/Dockerfile.llvm +++ b/docker/ubuntu/Dockerfile.llvm @@ -16,6 +16,7 @@ RUN CC=clang CXX=clang++ \ -DCMAKE_BUILD_TYPE=Release && \ make -j$(nproc) && \ make test && \ - make install + make install && \ + rm -rf /root/gtsam_points/build CMD ["bash"] diff --git a/docker/ubuntu/Dockerfile.llvm.cuda b/docker/ubuntu/Dockerfile.llvm.cuda index 33ac5250..5d4b8f16 100644 --- a/docker/ubuntu/Dockerfile.llvm.cuda +++ b/docker/ubuntu/Dockerfile.llvm.cuda @@ -16,6 +16,7 @@ RUN CC=clang CXX=clang++ \ -DBUILD_WITH_CUDA_MULTIARCH=ON \ -DCMAKE_BUILD_TYPE=Release && \ make -j$(nproc) && \ - make install + make install && \ + rm -rf /root/gtsam_points/build CMD ["bash"]