Skip to content

Commit fc6a009

Browse files
committed
GHA: Pass Docker Hub credentials as input to custom action
1 parent 967a906 commit fc6a009

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/actions/publish_docker_image/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Publish Docker images
22
description: Publish Docker images to Docker Hub
3+
inputs:
4+
DOCKER_USERNAME:
5+
description: Docker Hub username
6+
required: true
7+
DOCKER_TOKEN:
8+
description: Docker Hub token
9+
required: true
310
runs:
411
using: composite
512
steps:
@@ -19,8 +26,8 @@ runs:
1926
- name: Login to Docker Hub
2027
uses: docker/login-action@v3
2128
with:
22-
username: ${{ secrets.DOCKER_USERNAME }}
23-
password: ${{ secrets.DOCKER_PASSWORD }}
29+
username: ${{ inputs.DOCKER_USERNAME }}
30+
password: ${{ inputs.DOCKER_TOKEN }}
2431

2532
- name: Push to Docker Hub
2633
uses: docker/build-push-action@v6

.github/workflows/build_docker_image.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ jobs:
4949
((github.event_name == 'release' && github.event.action == 'published') || github.ref == 'refs/heads/main')
5050
&& github.repository == 'axiom-data-science/docker-erddap'
5151
uses: ./.github/actions/publish_docker_image
52+
with:
53+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
54+
DOCKER_TOKEN: ${{ secrets.DOCKER_PASSWORD }}

0 commit comments

Comments
 (0)