Skip to content

Commit

Permalink
Pass docker hub credentials from env
Browse files Browse the repository at this point in the history
Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Apr 21, 2024
1 parent fcc9b01 commit 92c3b12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ on:
description: Quay.io organization
default: mahendrapaipuri
push:
# paths:
# - "go.sum"
# - "go.mod"
# - "**.go"
# - ".github/workflows/**"
# - ".golangci.yml"
paths:
- "go.sum"
- "go.mod"
- "**.go"
- ".github/workflows/**"
- ".golangci.yml"
branches: [main]
pull_request:
branches: [main]
Expand Down Expand Up @@ -59,8 +59,6 @@ jobs:
with:
registry: "docker.io"
organization: ${{ inputs.docker_hub_organization }}
login: ${{ secrets.DOCKER_HUB_LOGIN }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

# quay:
# needs: [build]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/step_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ jobs:
- name: Publish image for main branch
if: github.ref == 'refs/heads/main'
run: |
echo ${{ inputs.password }} | docker login -u ${{ inputs.login }} --password-stdin ${{ inputs.registry }}
echo ${DOCKER_HUB_PASSWORD} | docker login -u ${DOCKER_HUB_LOGIN} --password-stdin ${{ inputs.registry }}
make docker-publish DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
make docker-manifest DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
shell: bash
env:
DOCKER_HUB_LOGIN: ${{ secrets.DOCKER_HUB_LOGIN }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}

0 comments on commit 92c3b12

Please sign in to comment.