Skip to content

Commit

Permalink
Merge pull request #10 from sbouchexbellomie-Philips/auth
Browse files Browse the repository at this point in the history
Added registry server authentication
  • Loading branch information
edwardvandevorst-philips authored Oct 23, 2024
2 parents b48fca0 + 0939028 commit 4fc967f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ and work path.
| extra_args | Extra arguments for docker run command. | `false` | |
| pre-warm | Run a warming-up container (which might crash due to first time use failure) | `false` | true |
| pre-warm-cmd | Pre warm command to run inside the container | `false` | echo "warming up!" |
| registry_authentication | Enable authentication on the registry server | `false` | `false`
| registry_username | Registry server username | `false`
| registry_token | Registry server token | `false`
| registry_repository | Registry server repository | `false`



Expand Down
26 changes: 25 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ inputs:
description: 'Pre warm command to run inside the container'
required: false
default: 'echo "warming up!"'

registry_authentication:
description : 'Authenticate against registry server'
required : false
default: 'false'
registry_username:
description: 'Docker registry username.'
required: false
registry_token:
description: 'Docker registry token'
required: false
registry_repository:
description: 'Docker registry repository'
required: false

runs:
using: "composite"
Expand All @@ -62,6 +74,12 @@ runs:
${{github.action_path}}/src/parse_input_paths.ps1 -githubWorkSpace "${{ github.workspace }}" -workspacePath "@${{ inputs.workspace_path }}" -mappingPath "@${{ inputs.mapping_path }}" -workPath "@${{ inputs.work_path }}";
${{github.action_path}}/src/parse_input_extra_args.ps1 -envNames "@${{ inputs.env_names }}" -entryPoint "@${{ inputs.entrypoint }}" -extraArgs "@${{ inputs.extra_args }}";
shell: powershell
- name: docker_login
id: docker_login
if: inputs.registry_authentication == 'true'
shell: powershell
run: >-
docker login ${{ inputs.registry_repository }} -u ${{ inputs.registry_username }} -p ${{ inputs.registry_token }}
- name: Pre-warm
if: inputs.pre-warm == 'true'
run: |
Expand All @@ -84,3 +102,9 @@ runs:
${{ inputs.run }}
}
shell: powershell
- name: docker_logout
id: docker_logout
if: inputs.registry_authentication == 'true'
shell: powershell
run: >-
docker logout ${{ inputs.registry_repository }}

0 comments on commit 4fc967f

Please sign in to comment.