Skip to content

Commit

Permalink
Merge pull request #97 from marrts/fix/docker_tags
Browse files Browse the repository at this point in the history
Change docker tag to match version, not hardcoded
  • Loading branch information
marrts committed May 15, 2024
2 parents 56c9b37 + c7e2a19 commit 19707ba
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,26 @@ jobs:
prefix=
suffix=
tags: |
type=ref,event=branch,prefix=${{ matrix.distro }}-
type=ref,event=pr,prefix=${{ matrix.distro }}-
type=ref,event=branch,prefix=${{ matrix.distro }}-,value=${{ env.BRANCH_NAME }}
type=raw,event=pr,prefix=${{ matrix.distro }}-,value=master
type=semver,pattern={{major}}.{{minor}},prefix=${{ matrix.distro }}-
- name: Set TAG environment variable based on metadata output
run: |
# All prior tesseract packages are on an OS level, being a ROS package, this is on a ROS distro level
TAG="${{ steps.meta.outputs.version }}"
# Replace all occurrences of matrix.distro with matrix.os in the generated tags. e.g. humble->jammy
TAG="${TAG//${{ matrix.distro }}/${{ matrix.os }}}"
# Export TAG to the environment variable for use in subsequent steps
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
build-args: |
TAG=${{ matrix.os }}-0.21
TAG=${{ env.TAG }}
ROS_DISTRO=${{ matrix.distro }}
push: ${{ env.PUSH_DOCKER_IMAGE }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down

0 comments on commit 19707ba

Please sign in to comment.