New Workflow Variable REGISTRY_HOST (custom)
Some checks failed
Build and Push Docker Image / build (push) Failing after 9s

This commit is contained in:
Frank Agerholm 2026-01-18 19:53:27 +01:00
commit 943f488bbe
No known key found for this signature in database

View file

@ -16,7 +16,7 @@ jobs:
- name: Login to Registry - name: Login to Registry
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ${GITHUB_SERVER_URL} registry: ${REGITRY_HOST}
username: ${{ secrets.REGISTRY_USER }} username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }} password: ${{ secrets.REGISTRY_PASSWORD }}
@ -26,20 +26,20 @@ jobs:
SHORT_HASH: ${{ github.sha }} SHORT_HASH: ${{ github.sha }}
run: | run: |
# Build the image with the commit hash tag # Build the image with the commit hash tag
docker build --build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} -t ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-${SHORT_HASH:0:5} . docker build --build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} -t ${REGITRY_HOST}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-${SHORT_HASH:0:5} .
# Tag the same image as "latest" # Tag the same image as "latest"
docker tag ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-${SHORT_HASH:0:5} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-latest docker tag ${REGITRY_HOST}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-${SHORT_HASH:0:5} ${REGITRY_HOST}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-latest
- name: Push Docker Images - name: Push Docker Images
env: env:
BRANCH_NAME: ${{ github.ref_name }} BRANCH_NAME: ${{ github.ref_name }}
SHORT_HASH: ${{ github.sha }} SHORT_HASH: ${{ github.sha }}
run: | run: |
docker push ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-${SHORT_HASH:0:5} docker push ${REGITRY_HOST}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-${SHORT_HASH:0:5}
docker push ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-latest docker push ${REGITRY_HOST}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-latest
- name: Log out from registry - name: Log out from registry
if: always() if: always()
run: docker logout ${GITHUB_SERVER_URL} run: docker logout ${REGITRY_HOST}