Skip to content

Commit 601f1bc

Browse files
committed
fix: Use inputs for action
1 parent e961d82 commit 601f1bc

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

.github/actions/shared-build-steps/action.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
name: "Shared buildsteps"
2+
inputs:
3+
dockerhub_user:
4+
required: true
5+
dockerhub_password:
6+
required: true
7+
runner_os:
8+
required: true
9+
github_sha:
10+
required: true
211
runs:
312
using: "composite"
413
steps:
514
- name: Login to Docker Hub 🔐🐳
615
uses: docker/login-action@v1
716
with:
8-
username: ${{ secrets.DOCKERHUB_USER }}
9-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
17+
username: ${{ inputs.dockerhub_user }}
18+
password: ${{ inputs.dockerhub_password }}
1019

1120
- name: Set up QEMU 🏗️
1221
uses: docker/setup-qemu-action@v1
@@ -29,6 +38,6 @@ runs:
2938
uses: actions/cache@v2
3039
with:
3140
path: /tmp/.buildx-cache
32-
key: ${{ runner.os }}-buildx-${{ github.sha }}
41+
key: ${{ inputs.runner_os }}-buildx-${{ inputs.github_sha }}
3342
restore-keys: |
34-
${{ runner.os }}-buildx-
43+
${{ inputs.runner_os }}-buildx-

.github/workflows/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ jobs:
2525
uses: actions/checkout@v2
2626

2727
- uses: ./.github/actions/shared-build-steps
28+
with:
29+
dockerhub_user: ${{ secrets.DOCKERHUB_USER }}
30+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
31+
runner_os: ${{ runner.os }}
32+
github_sha: ${{ github.sha }}
2833

2934
- name: Docker meta 💬
3035
id: meta
@@ -57,6 +62,11 @@ jobs:
5762
uses: actions/checkout@v2
5863

5964
- uses: ./.github/actions/shared-build-steps
65+
with:
66+
dockerhub_user: ${{ secrets.DOCKERHUB_USER }}
67+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
68+
runner_os: ${{ runner.os }}
69+
github_sha: ${{ github.sha }}
6070

6171
- name: Docker meta 💬
6272
id: meta

0 commit comments

Comments
 (0)