Skip to content

Commit

Permalink
Update workflow for tagging in compose files (#51)
Browse files Browse the repository at this point in the history
* Update workflow for tagging in compose files

* Remove unused env
  • Loading branch information
pawelirh authored Apr 30, 2024
1 parent a44154b commit f27e204
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}

0 comments on commit f27e204

Please sign in to comment.