Skip to content

Commit

Permalink
feat: Add can_registry
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxeye committed Nov 12, 2024
1 parent 2246350 commit ef5bd53
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/docker-name-version-arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
required: false
type: string
can_registry:
description: 'Determines whether this workflow will also registry (login and push).'
required: false
type: boolean
###
### Secrets
###
Expand Down Expand Up @@ -264,3 +268,23 @@ jobs:
with:
command: |
make manifest-push NAME=${{ matrix.name }} VERSION="${{ matrix.version }}" TAG=${{ steps.tag.outputs.docker-tag }}
# ------------------------------------------------------------
# REGISTRY
# ------------------------------------------------------------
- name: "[REGISTRY] Login"
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
if: inputs.can_registry

- name: "[REGISTRY] Push"
uses: linuxeye/shell-command-retry-action@master
with:
command: |
docker pull bypanel/${{ matrix.name }}:${{ steps.tag.outputs.docker-tag }}
docker tag bypanel/${{ matrix.name }}:${{ steps.tag.outputs.docker-tag }} ${{ secrets.REGISTRY_URL }}/bypanel/${{ matrix.name }}:${{ steps.tag.outputs.docker-tag }}
docker push ${{ secrets.REGISTRY_URL }}/bypanel/${{ matrix.name }}:${{ steps.tag.outputs.docker-tag }}
if: inputs.can_registry
2 changes: 1 addition & 1 deletion .github/workflows/docker-name-version-flavour-arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,4 @@ jobs:
docker pull bypanel/${{ matrix.name }}:${{ steps.tag.outputs.docker-tag }}
docker tag bypanel/${{ matrix.name }}:${{ steps.tag.outputs.docker-tag }} ${{ secrets.REGISTRY_URL }}/bypanel/${{ matrix.name }}:${{ steps.tag.outputs.docker-tag }}
docker push ${{ secrets.REGISTRY_URL }}/bypanel/${{ matrix.name }}:${{ steps.tag.outputs.docker-tag }}
if: inputs.can_registry
if: inputs.can_registry

0 comments on commit ef5bd53

Please sign in to comment.