Skip to content

Commit

Permalink
Build and push dev tag first
Browse files Browse the repository at this point in the history
to not cache from stale stages
as otherwise caching from multple regestry images seems error prone
  • Loading branch information
ruffsl committed Mar 8, 2023
1 parent e5bef97 commit 12dd5b1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/update_ci_image.yaml
Expand Up @@ -91,24 +91,24 @@ jobs:
trigger=true
fi
echo "::set-output name=trigger::${trigger}"
- name: Build and push ${{ github.ref_name }}
- name: Build and push ${{ github.ref_name }}-dev
if: steps.config.outputs.trigger == 'true'
id: docker_build
uses: docker/build-push-action@v4
with:
pull: true
push: true
no-cache: ${{ steps.config.outputs.no_cache }}
cache-from: type=registry,ref=ghcr.io/ros-planning/navigation2:${{ github.ref_name }}
cache-from: type=registry,ref=ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-dev
cache-to: type=inline
target: builder
target: tester
tags: |
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-${{ steps.config.outputs.timestamp }}
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-dev
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-dev-${{ steps.config.outputs.timestamp }}
- name: Image digest
if: steps.config.outputs.trigger == 'true'
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Build and push ${{ github.ref_name }}-dev
- name: Build and push ${{ github.ref_name }}
if: steps.config.outputs.trigger == 'true'
id: docker_build
uses: docker/build-push-action@v4
Expand All @@ -117,10 +117,10 @@ jobs:
push: true
cache-from: type=registry,ref=ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-dev
cache-to: type=inline
target: tester
target: builder
tags: |
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-dev
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-dev-${{ steps.config.outputs.timestamp }}
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-${{ steps.config.outputs.timestamp }}
- name: Image digest
if: steps.config.outputs.trigger == 'true'
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit 12dd5b1

Please sign in to comment.