Skip to content

Commit

Permalink
Extract container registry credentials to workflow inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lbianchi-lbl committed Mar 13, 2024
1 parent 3b09b72 commit dab4277
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/check-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ on:
required: false
default: ghcr.io

container-registry-username:
description: Username to container registry
type: string
required: false
default: ${{ github.actor }}

container-registry-password:
description: Password to container registry
type: string
required: false
default: ${{ secrets.GITHUB_TOKEN }}

binder-cache-branch:
description: If set (default), the built container image will be written to .binder/Dockerfile and pushed to this branch. To disable this, set it to the empty string.
type: string
Expand Down Expand Up @@ -152,8 +164,8 @@ jobs:
with:
NO_PUSH: "false"
DOCKER_REGISTRY: ${{ inputs.container-registry }}
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ inputs.container-registry-username }}
DOCKER_PASSWORD: ${{ inputs.container-registry-password }}
IMAGE_NAME: ${{ env.NORMALIZED_IMAGE_NAME }}
MYBINDERORG_TAG: ${{ github.sha }}

Expand All @@ -167,9 +179,9 @@ jobs:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ inputs.container-registry }}
username: ${{ inputs.container-registry-username }}
password: ${{ inputs.container-registry-password }}

- name: Run command to test built image ${{ needs.image-build.outputs.image }}
id: run
Expand Down

0 comments on commit dab4277

Please sign in to comment.