Skip to content

Commit 66d7080

Browse files
Added login and logout
1 parent b48fca0 commit 66d7080

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

action.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ inputs:
4545
description: 'Pre warm command to run inside the container'
4646
required: false
4747
default: 'echo "warming up!"'
48-
48+
username:
49+
description: 'Docker username.'
50+
required: false
51+
repository:
52+
description: 'Docker repository.'
53+
required: false
4954

5055
runs:
5156
using: "composite"
@@ -62,6 +67,11 @@ runs:
6267
${{github.action_path}}/src/parse_input_paths.ps1 -githubWorkSpace "${{ github.workspace }}" -workspacePath "@${{ inputs.workspace_path }}" -mappingPath "@${{ inputs.mapping_path }}" -workPath "@${{ inputs.work_path }}";
6368
${{github.action_path}}/src/parse_input_extra_args.ps1 -envNames "@${{ inputs.env_names }}" -entryPoint "@${{ inputs.entrypoint }}" -extraArgs "@${{ inputs.extra_args }}";
6469
shell: powershell
70+
- name: docker_login
71+
id: docker_login
72+
shell: powershell
73+
run: >-
74+
echo ${{ secrets.docker_secret }} | docker login ${{ inputs.repository }} -u ${{ inputs.username }} --password-stdin
6575
- name: Pre-warm
6676
if: inputs.pre-warm == 'true'
6777
run: |
@@ -84,3 +94,8 @@ runs:
8494
${{ inputs.run }}
8595
}
8696
shell: powershell
97+
- name: docker_logout
98+
id: docker_logout
99+
shell: powershell
100+
run: >-
101+
docker logout ${{ inputs.repository }}

0 commit comments

Comments
 (0)