Skip to content

Commit

Permalink
Remove slash from refs for docker (#8848)
Browse files Browse the repository at this point in the history
* Filter out slashes from ref

* Checkout the desired commit
  • Loading branch information
pablin-10 authored Nov 27, 2024
1 parent 1adf6c4 commit 4eb32ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/push-dev-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.ref_name || github.ref }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -66,16 +67,18 @@ jobs:
name: Create Docker Image Tag for release candidate
if: startsWith(github.ref, 'refs/tags/v')
run: |
GITHUB_TAG=${{ github.ref_name }}
GITHUB_TAG=${{ github.event.inputs.ref_name || github.ref_name }}
echo "DOCKER_IMAGE_TAG=${GITHUB_TAG#v}" >> $GITHUB_ENV
echo "OSMOSIS_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo "OSMOSIS_VERSION=${{ github.event.inputs.ref_name || github.ref_name }}" >> $GITHUB_ENV
-
name: Create Docker Image Tag for vN.x branch
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-8)
echo "DOCKER_IMAGE_TAG=${{ github.ref_name }}-${SHORT_SHA}-$(date +%s)" >> $GITHUB_ENV
echo "OSMOSIS_VERSION=${{ github.ref_name }}-$SHORT_SHA" >> $GITHUB_ENV
REF_NAME=${{ github.event.inputs.ref_name || github.ref_name }}
SAFE_REF_NAME=${REF_NAME//\//-}
echo "DOCKER_IMAGE_TAG=${SAFE_REF_NAME}-${SHORT_SHA}-$(date +%s)" >> $GITHUB_ENV
echo "OSMOSIS_VERSION=${SAFE_REF_NAME}-$SHORT_SHA" >> $GITHUB_ENV
-
name: Build and Push Docker Images
uses: docker/build-push-action@v6
Expand Down

0 comments on commit 4eb32ab

Please sign in to comment.