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 7d110d2 commit 2246350
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/docker-name-version-flavour-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,24 @@ jobs:
with:
command: |
make manifest-push NAME=${{ matrix.name }} VERSION="${{ matrix.version }}" FLAVOUR=${{ matrix.flavour }} 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

0 comments on commit 2246350

Please sign in to comment.