Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added registry server authentication #10

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading