diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d13e6ccd..3645dd71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,14 +2,14 @@ name: CI on: workflow_dispatch: inputs: + docker_hub_registry: + type: string + description: DockerHub registry + default: docker.io docker_hub_organization: type: string description: DockerHub organization default: mahendrapaipuri - quay_io_organization: - type: string - description: Quay.io organization - default: mahendrapaipuri push: paths: - "go.sum" @@ -55,14 +55,13 @@ jobs: docker: needs: [build] - runs-on: ubuntu-latest - steps: - - uses: ./.github/workflows/step_docker.yml - with: - registry: "docker.io" - organization: ${{ inputs.docker_hub_organization }} - login: ${{ secrets.DOCKER_HUB_LOGIN }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} + uses: ./.github/workflows/step_docker.yml + with: + registry: ${{ inputs.docker_hub_registry }} + organization: ${{ inputs.docker_hub_organization }} + secrets: + login: ${{ secrets.DOCKER_HUB_LOGIN }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} # quay: # needs: [build] diff --git a/.github/workflows/step_docker.yml b/.github/workflows/step_docker.yml index c7b3936e..556ec022 100644 --- a/.github/workflows/step_docker.yml +++ b/.github/workflows/step_docker.yml @@ -6,19 +6,20 @@ on: inputs: registry: type: string - description: Docker registry + description: Registry organization: type: string description: Organization + secrets: login: - type: string - description: Username + required: true + description: '' password: - type: string - description: Password + required: true + description: '' jobs: - packaging: + images: name: docker runs-on: ubuntu-latest steps: @@ -60,7 +61,7 @@ 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 ${{ secrets.password }} | docker login -u ${{ secrets.login }} --password-stdin ${{ inputs.registry }} make docker-publish DOCKER_IMAGE_TAG=${{ steps.get_branch.outputs.branch }} DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }} make docker-manifest DOCKER_IMAGE_TAG=${{ steps.get_branch.outputs.branch }} DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }} shell: bash