From cdc0b1332393284f4cf98a80b7bb0c7e266a2f47 Mon Sep 17 00:00:00 2001 From: Johnson Sun Date: Sat, 14 Dec 2024 03:05:16 +0800 Subject: [PATCH] ci: Push image after cache For correctly getting latest image tag for docs --- .github/workflows/build-aloha-ws.yaml | 13 +++++++++++-- .github/workflows/build-cartographer-ws.yaml | 13 +++++++++++-- .github/workflows/build-gazebo-world-ws.yaml | 13 +++++++++++-- .github/workflows/build-husky-ws.yaml | 13 +++++++++++-- .github/workflows/build-kobuki-ws.yaml | 13 +++++++++++-- .github/workflows/build-orbslam3-ws.yaml | 13 +++++++++++-- .github/workflows/build-rtabmap-ws.yaml | 13 +++++++++++-- .github/workflows/build-template-ws.yaml | 10 ++++++++-- .github/workflows/build-vlp-ws.yaml | 13 +++++++++++-- 9 files changed, 96 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-aloha-ws.yaml b/.github/workflows/build-aloha-ws.yaml index 7b2f3180..a447e067 100644 --- a/.github/workflows/build-aloha-ws.yaml +++ b/.github/workflows/build-aloha-ws.yaml @@ -98,7 +98,7 @@ jobs: run: docker pull --platform linux/amd64 j3soon/ros2-template-ws - name: Pull j3soon/ros2-template-ws (arm64) run: docker pull --platform linux/arm64 j3soon/ros2-template-ws - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: aloha_ws/docker @@ -106,7 +106,6 @@ jobs: j3soon/ros2-template-ws:buildcache-amd64 j3soon/ros2-template-ws:buildcache-arm64 platforms: linux/amd64,linux/arm64 - push: true tags: ${{ steps.meta.outputs.tags }} - name: Push amd64 cache uses: docker/build-push-action@v6 @@ -128,3 +127,13 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-aloha-ws:buildcache-arm64,mode=max platforms: linux/arm64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: aloha_ws/docker + cache-from: | + j3soon/ros2-template-ws:buildcache-amd64 + j3soon/ros2-template-ws:buildcache-arm64 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-cartographer-ws.yaml b/.github/workflows/build-cartographer-ws.yaml index 461ca4e9..52b29906 100644 --- a/.github/workflows/build-cartographer-ws.yaml +++ b/.github/workflows/build-cartographer-ws.yaml @@ -96,7 +96,7 @@ jobs: run: docker pull --platform linux/amd64 j3soon/ros2-template-ws - name: Pull j3soon/ros2-template-ws (arm64) run: docker pull --platform linux/arm64 j3soon/ros2-template-ws - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: cartographer_ws/docker @@ -104,7 +104,6 @@ jobs: j3soon/ros2-template-ws:buildcache-amd64 j3soon/ros2-template-ws:buildcache-arm64 platforms: linux/amd64,linux/arm64 - push: true tags: ${{ steps.meta.outputs.tags }} - name: Push amd64 cache uses: docker/build-push-action@v6 @@ -126,3 +125,13 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-cartographer-ws:buildcache-arm64,mode=max platforms: linux/arm64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: cartographer_ws/docker + cache-from: | + j3soon/ros2-template-ws:buildcache-amd64 + j3soon/ros2-template-ws:buildcache-arm64 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-gazebo-world-ws.yaml b/.github/workflows/build-gazebo-world-ws.yaml index d6548dab..c9f94823 100644 --- a/.github/workflows/build-gazebo-world-ws.yaml +++ b/.github/workflows/build-gazebo-world-ws.yaml @@ -96,7 +96,7 @@ jobs: run: docker pull --platform linux/amd64 j3soon/ros2-template-ws - name: Pull j3soon/ros2-template-ws (arm64) run: docker pull --platform linux/arm64 j3soon/ros2-template-ws - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: gazebo_world_ws/docker @@ -104,7 +104,6 @@ jobs: j3soon/ros2-template-ws:buildcache-amd64 j3soon/ros2-template-ws:buildcache-arm64 platforms: linux/amd64 - push: true tags: ${{ steps.meta.outputs.tags }} - name: Push amd64 cache uses: docker/build-push-action@v6 @@ -116,3 +115,13 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-gazebo-world-ws:buildcache-amd64,mode=max platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: gazebo_world_ws/docker + cache-from: | + j3soon/ros2-template-ws:buildcache-amd64 + j3soon/ros2-template-ws:buildcache-arm64 + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-husky-ws.yaml b/.github/workflows/build-husky-ws.yaml index 63ad6e3e..3f4f23c0 100644 --- a/.github/workflows/build-husky-ws.yaml +++ b/.github/workflows/build-husky-ws.yaml @@ -99,7 +99,7 @@ jobs: run: docker pull --platform linux/amd64 j3soon/ros2-template-ws - name: Pull j3soon/ros2-template-ws (arm64) run: docker pull --platform linux/arm64 j3soon/ros2-template-ws - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: husky_ws/docker @@ -107,7 +107,6 @@ jobs: j3soon/ros2-template-ws:buildcache-amd64 j3soon/ros2-template-ws:buildcache-arm64 platforms: linux/amd64,linux/arm64 - push: true tags: ${{ steps.meta.outputs.tags }} - name: Push amd64 cache uses: docker/build-push-action@v6 @@ -129,3 +128,13 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-husky-ws:buildcache-arm64,mode=max platforms: linux/arm64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: husky_ws/docker + cache-from: | + j3soon/ros2-template-ws:buildcache-amd64 + j3soon/ros2-template-ws:buildcache-arm64 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-kobuki-ws.yaml b/.github/workflows/build-kobuki-ws.yaml index 749ee62e..1adf30b4 100644 --- a/.github/workflows/build-kobuki-ws.yaml +++ b/.github/workflows/build-kobuki-ws.yaml @@ -98,7 +98,7 @@ jobs: run: docker pull --platform linux/amd64 j3soon/ros2-template-ws - name: Pull j3soon/ros2-template-ws (arm64) run: docker pull --platform linux/arm64 j3soon/ros2-template-ws - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: kobuki_ws/docker @@ -106,7 +106,6 @@ jobs: j3soon/ros2-template-ws:buildcache-amd64 j3soon/ros2-template-ws:buildcache-arm64 platforms: linux/amd64,linux/arm64 - push: true tags: ${{ steps.meta.outputs.tags }} - name: Push amd64 cache uses: docker/build-push-action@v6 @@ -128,3 +127,13 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-kobuki-ws:buildcache-arm64,mode=max platforms: linux/arm64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: kobuki_ws/docker + cache-from: | + j3soon/ros2-template-ws:buildcache-amd64 + j3soon/ros2-template-ws:buildcache-arm64 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-orbslam3-ws.yaml b/.github/workflows/build-orbslam3-ws.yaml index a7f959eb..99a041b1 100644 --- a/.github/workflows/build-orbslam3-ws.yaml +++ b/.github/workflows/build-orbslam3-ws.yaml @@ -96,7 +96,7 @@ jobs: run: docker pull --platform linux/amd64 j3soon/ros2-template-ws - name: Pull j3soon/ros2-template-ws (arm64) run: docker pull --platform linux/arm64 j3soon/ros2-template-ws - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: orbslam3_ws/docker @@ -104,7 +104,6 @@ jobs: j3soon/ros2-template-ws:buildcache-amd64 j3soon/ros2-template-ws:buildcache-arm64 platforms: linux/amd64 - push: true tags: ${{ steps.meta.outputs.tags }} - name: Push amd64 cache uses: docker/build-push-action@v6 @@ -116,3 +115,13 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-orbslam3-ws:buildcache-amd64,mode=max platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: orbslam3_ws/docker + cache-from: | + j3soon/ros2-template-ws:buildcache-amd64 + j3soon/ros2-template-ws:buildcache-arm64 + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-rtabmap-ws.yaml b/.github/workflows/build-rtabmap-ws.yaml index 7bb92b1a..1b69eddb 100644 --- a/.github/workflows/build-rtabmap-ws.yaml +++ b/.github/workflows/build-rtabmap-ws.yaml @@ -96,7 +96,7 @@ jobs: run: docker pull --platform linux/amd64 j3soon/ros2-template-ws - name: Pull j3soon/ros2-template-ws (arm64) run: docker pull --platform linux/arm64 j3soon/ros2-template-ws - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: rtabmap_ws/docker @@ -104,7 +104,6 @@ jobs: j3soon/ros2-template-ws:buildcache-amd64 j3soon/ros2-template-ws:buildcache-arm64 platforms: linux/amd64 - push: true tags: ${{ steps.meta.outputs.tags }} - name: Push amd64 cache uses: docker/build-push-action@v6 @@ -116,3 +115,13 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-rtabmap-ws:buildcache-amd64,mode=max platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: rtabmap_ws/docker + cache-from: | + j3soon/ros2-template-ws:buildcache-amd64 + j3soon/ros2-template-ws:buildcache-arm64 + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-template-ws.yaml b/.github/workflows/build-template-ws.yaml index 04a7b7a0..5de9efe0 100644 --- a/.github/workflows/build-template-ws.yaml +++ b/.github/workflows/build-template-ws.yaml @@ -96,12 +96,11 @@ jobs: with: username: j3soon password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: template_ws/docker platforms: linux/amd64,linux/arm64 - push: true tags: ${{ steps.meta.outputs.tags }} # Ref: https://github.com/docker/buildx/discussions/1382#discussioncomment-6252049 - name: Push amd64 cache @@ -118,3 +117,10 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-template-ws:buildcache-arm64,mode=max platforms: linux/arm64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: template_ws/docker + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-vlp-ws.yaml b/.github/workflows/build-vlp-ws.yaml index 465638b9..763e402b 100644 --- a/.github/workflows/build-vlp-ws.yaml +++ b/.github/workflows/build-vlp-ws.yaml @@ -96,7 +96,7 @@ jobs: run: docker pull --platform linux/amd64 j3soon/ros2-template-ws - name: Pull j3soon/ros2-template-ws (arm64) run: docker pull --platform linux/arm64 j3soon/ros2-template-ws - - name: Build and push + - name: Build image uses: docker/build-push-action@v6 with: context: vlp_ws/docker @@ -104,7 +104,6 @@ jobs: j3soon/ros2-template-ws:buildcache-amd64 j3soon/ros2-template-ws:buildcache-arm64 platforms: linux/amd64,linux/arm64 - push: true tags: ${{ steps.meta.outputs.tags }} - name: Push amd64 cache uses: docker/build-push-action@v6 @@ -126,3 +125,13 @@ jobs: cache-to: type=registry,ref=j3soon/ros2-vlp-ws:buildcache-arm64,mode=max platforms: linux/arm64 tags: ${{ steps.meta.outputs.tags }} + - name: Push image + uses: docker/build-push-action@v6 + with: + context: vlp_ws/docker + cache-from: | + j3soon/ros2-template-ws:buildcache-amd64 + j3soon/ros2-template-ws:buildcache-arm64 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }}