From f27e20421e6e17499ffbcef875941156efbbde0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Irzyk?= <108666440+pawelirh@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:50:58 +0200 Subject: [PATCH] Update workflow for tagging in compose files (#51) * Update workflow for tagging in compose files * Remove unused env --- ...ranch.yaml => update-tags-in-compose.yaml} | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) rename .github/workflows/{prepare-test-branch.yaml => update-tags-in-compose.yaml} (52%) diff --git a/.github/workflows/prepare-test-branch.yaml b/.github/workflows/update-tags-in-compose.yaml similarity index 52% rename from .github/workflows/prepare-test-branch.yaml rename to .github/workflows/update-tags-in-compose.yaml index f355d6c..a7e1464 100644 --- a/.github/workflows/prepare-test-branch.yaml +++ b/.github/workflows/update-tags-in-compose.yaml @@ -1,14 +1,14 @@ --- -name: Prepare test branch +name: Update tags in compose files on: workflow_dispatch: inputs: target_branch: - description: Target branch for the pre-release test. + description: Target branch for the update. required: true - test_branch: - description: Test branch name (used as a docker image tag). + image_tag: + description: Docker image tag to be replaced with. required: true jobs: @@ -17,24 +17,22 @@ jobs: runs-on: ubuntu-22.04 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCKER_IMAGE_TAG: humble-${{ github.event.inputs.test_branch }} steps: - name: Checkout uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.target_branch }} - - name: Update docker image version + - name: Update docker image tag uses: mikefarah/yq@v4.43.1 with: cmd: | - yq -i '.services.panther_ros.image = "husarion/panther:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml - yq -i '.services.panther_gazebo.image = "husarion/panther-gazebo:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml + yq -i '.services.panther_ros.image = "husarion/panther:${{ github.event.inputs.image_tag }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml + yq -i '.services.panther_gazebo.image = "husarion/panther-gazebo:${{ github.event.inputs.image_tag }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml - - name: Commit changes to test branch + - name: Commit changes to target branch uses: EndBug/add-and-commit@v9 with: - message: Update docker image version + message: Update docker image tag author_name: action-bot author_email: action-bot@action-bot.com - new_branch: ${{ github.event.inputs.test_branch }}