From f0470bbb96e163b970d88dd0252a47034873638f Mon Sep 17 00:00:00 2001 From: Manuel Segarra-Abad Date: Fri, 29 Apr 2022 14:43:40 +0300 Subject: [PATCH] Handle update of fog-ros-baseimage update --- .github/workflows/tii-mocap-pose.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tii-mocap-pose.yaml b/.github/workflows/tii-mocap-pose.yaml index 0c28c78..42dbf16 100644 --- a/.github/workflows/tii-mocap-pose.yaml +++ b/.github/workflows/tii-mocap-pose.yaml @@ -1,6 +1,8 @@ name: tii-mocap-pose on: + repository_dispatch: + types: [fog-ros-baseimage-update] push: jobs: @@ -13,6 +15,18 @@ jobs: - uses: docker/setup-buildx-action@v1 + - name: Set image tag format without suffix + run: | + echo "IMAGE_TAG_FORMAT=type=sha" >> $GITHUB_ENV + if: github.event_name == 'push' + + - name: Set image tag format with suffix + # it is possible that run_number should be used instead run_attempt + # run_attempt is unique number on every run and run_attempt resets to 1 if re-build is not used + run: | + echo "IMAGE_TAG_FORMAT=type=sha,suffix=-${{ github.event.client_payload.run_attempt }}" >> $GITHUB_ENV + if: github.event_name == 'repository_dispatch' + - name: Docker meta id: meta uses: docker/metadata-action@v3 @@ -21,8 +35,8 @@ jobs: tags: | type=ref,event=branch type=semver,pattern={{version}} - type=sha type=raw,value=latest + ${{ env.IMAGE_TAG_FORMAT }} - name: Login to GitHub Container Registry uses: docker/login-action@v1