Some checks failed
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
# Composite action for logging into Docker registries (GHCR and/or DockerHub).
|
|
# Centralizes the login pattern used across multiple Docker workflows.
|
|
|
|
name: 'Docker Registry Login'
|
|
description: 'Login to GitHub Container Registry and/or DockerHub'
|
|
|
|
inputs:
|
|
login-ghcr:
|
|
description: 'Login to GitHub Container Registry'
|
|
required: false
|
|
default: 'true'
|
|
login-dockerhub:
|
|
description: 'Login to DockerHub'
|
|
required: false
|
|
default: 'false'
|
|
login-dhi:
|
|
description: 'Login to Docker Hardened Images registry (dhi.io)'
|
|
required: false
|
|
default: 'false'
|
|
dockerhub-username:
|
|
description: 'DockerHub username (required if login-dockerhub or login-dhi is true)'
|
|
required: false
|
|
dockerhub-password:
|
|
description: 'DockerHub password (required if login-dockerhub or login-dhi is true)'
|
|
required: false
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Login to GitHub Container Registry
|
|
if: inputs.login-ghcr == 'true'
|
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ github.token }}
|
|
|
|
- name: Login to DockerHub
|
|
if: inputs.login-dockerhub == 'true'
|
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
|
with:
|
|
username: ${{ inputs.dockerhub-username }}
|
|
password: ${{ inputs.dockerhub-password }}
|
|
|
|
- name: Login to DHI Registry
|
|
if: inputs.login-dhi == 'true'
|
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
|
with:
|
|
registry: dhi.io
|
|
username: ${{ inputs.dockerhub-username }}
|
|
password: ${{ inputs.dockerhub-password }}
|