Skip to content

Commit

Permalink
move registry creds to inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
varesa committed Apr 12, 2024
1 parent 3ee33fa commit bc2a9f6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/build-action/action.yml
@@ -1,5 +1,11 @@
name: build-action

inputs:
registry_username:
required: true
registry_password:
required: true

runs:
using: composite
steps:
Expand Down Expand Up @@ -38,8 +44,8 @@ runs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ inputs.registry_username }}
password: ${{ inputs.registry_password }}

- name: Build and push
if: steps.check_registry.outputs.exists == 'false'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/prod.yml
Expand Up @@ -23,6 +23,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
registry_username: ${{ github.actor }}
registry_password: ${{ github.token }}
- name: build-action
uses: ./.github/build-action
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -14,6 +14,9 @@ jobs:
uses: actions/checkout@v4
- name: build-action
uses: ./.github/build-action
with:
registry_username: ${{ github.actor }}
registry_password: ${{ github.token }}

deploy:
runs-on: actions-runner
Expand Down

0 comments on commit bc2a9f6

Please sign in to comment.