Skip to content

Commit

Permalink
fix: Use inputs for action
Browse files Browse the repository at this point in the history
  • Loading branch information
aiakide committed Nov 8, 2023
1 parent e961d82 commit 601f1bc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/actions/shared-build-steps/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
name: "Shared buildsteps"
inputs:
dockerhub_user:
required: true
dockerhub_password:
required: true
runner_os:
required: true
github_sha:
required: true
runs:
using: "composite"
steps:
- name: Login to Docker Hub 🔐🐳
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
username: ${{ inputs.dockerhub_user }}
password: ${{ inputs.dockerhub_password }}

- name: Set up QEMU 🏗️
uses: docker/setup-qemu-action@v1
Expand All @@ -29,6 +38,6 @@ runs:
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
key: ${{ inputs.runner_os }}-buildx-${{ inputs.github_sha }}
restore-keys: |
${{ runner.os }}-buildx-
${{ inputs.runner_os }}-buildx-
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
uses: actions/checkout@v2

- uses: ./.github/actions/shared-build-steps
with:
dockerhub_user: ${{ secrets.DOCKERHUB_USER }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
runner_os: ${{ runner.os }}
github_sha: ${{ github.sha }}

- name: Docker meta 💬
id: meta
Expand Down Expand Up @@ -57,6 +62,11 @@ jobs:
uses: actions/checkout@v2

- uses: ./.github/actions/shared-build-steps
with:
dockerhub_user: ${{ secrets.DOCKERHUB_USER }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
runner_os: ${{ runner.os }}
github_sha: ${{ github.sha }}

- name: Docker meta 💬
id: meta
Expand Down

0 comments on commit 601f1bc

Please sign in to comment.