From 634bda0bc10b90f53904c4cf7b977852edd252f5 Mon Sep 17 00:00:00 2001 From: Depetrol Date: Fri, 2 Aug 2024 23:36:23 -0700 Subject: [PATCH] rti-docker workflow match digests Update .github/actions/push-rti-docker/action.yml Co-authored-by: Marten Lohstroh Update .github/actions/push-rti-docker/action.yml Co-authored-by: Marten Lohstroh Move if to end of block Move if to end of block --- .github/actions/push-rti-docker/action.yml | 13 +++++++++++++ .github/workflows/rti-docker.yml | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/actions/push-rti-docker/action.yml b/.github/actions/push-rti-docker/action.yml index 83fb67ff3b..eece007544 100644 --- a/.github/actions/push-rti-docker/action.yml +++ b/.github/actions/push-rti-docker/action.yml @@ -11,6 +11,9 @@ inputs: DOCKERHUB_TOKEN: description: 'The token to log in to Docker Hub' required: true + latest: + description: 'Also push as latest tag if true' + default: 'false' runs: using: "composite" steps: @@ -34,3 +37,13 @@ runs: platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/riscv64 push: true tags: lflang/rti:${{ inputs.tag }} + if: ${{ inputs.latest == 'false' }} + - name: Build and push as latest + uses: docker/build-push-action@v6 + with: + file: ./core/src/main/resources/lib/c/reactor-c/core/federated/RTI/rti.Dockerfile + context: ./core/src/main/resources/lib/c/reactor-c + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/riscv64 + push: true + tags: lflang/rti:${{ inputs.tag }}, lflang/rti:latest + if: ${{ inputs.latest == 'true' }} diff --git a/.github/workflows/rti-docker.yml b/.github/workflows/rti-docker.yml index 32c21d27b4..e7132ebbbb 100644 --- a/.github/workflows/rti-docker.yml +++ b/.github/workflows/rti-docker.yml @@ -27,12 +27,16 @@ jobs: uses: ./.github/actions/push-rti-docker with: tag: ${{ env.lf_version }} + latest: false DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + if: ${{ endsWith(env.lf_version, '-snapshot') }} + - name: Update latest (released versions only) uses: ./.github/actions/push-rti-docker with: - tag: latest + tag: ${{ env.lf_version }} + latest: true DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} if: ${{ !endsWith(env.lf_version, '-snapshot') }}