Skip to content

Commit

Permalink
ci: Fix docker publishing workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Aug 17, 2024
1 parent 7429f2c commit 0d551d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/step_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:

- name: Get step vars
id: vars
env:
REGISTRY_PROVIDER: ${{ inputs.registry_provider }}
run: |
if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
echo "branch_name=$(echo ${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
Expand All @@ -41,7 +43,7 @@ jobs:
fi
# Repo name for container registries
if [ ${{ inputs.registry_provider }} == 'dockerhub' ]; then
if [[ "${REGISTRY_PROVIDER}" == "dockerhub" ]]; then
echo "repo_name=$(make docker-repo-name)" >> $GITHUB_OUTPUT
else
export DOCKER_REPO="$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')"
Expand All @@ -68,7 +70,7 @@ jobs:
run: make test-docker DOCKER_IMAGE_TAG=${{ steps.vars.outputs.branch_name }} DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}

- name: Publish image for current branch/tag
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
run: |
echo ${{ secrets.password }} | docker login -u ${{ secrets.login }} --password-stdin ${{ inputs.registry }}
make docker-publish DOCKER_IMAGE_TAG=${{ steps.vars.outputs.branch_name }} DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
Expand Down

0 comments on commit 0d551d4

Please sign in to comment.