New Workflow Variable REGISTRY_HOST (custom)
Some checks failed
Build and Push Docker Image / build (push) Failing after 9s
Some checks failed
Build and Push Docker Image / build (push) Failing after 9s
This commit is contained in:
parent
497468c8e9
commit
943f488bbe
1 changed files with 6 additions and 6 deletions
|
|
@ -16,7 +16,7 @@ jobs:
|
|||
- name: Login to Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${GITHUB_SERVER_URL}
|
||||
registry: ${REGITRY_HOST}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
|
|
@ -26,20 +26,20 @@ jobs:
|
|||
SHORT_HASH: ${{ github.sha }}
|
||||
run: |
|
||||
# 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"
|
||||
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
|
||||
env:
|
||||
BRANCH_NAME: ${{ github.ref_name }}
|
||||
SHORT_HASH: ${{ github.sha }}
|
||||
run: |
|
||||
docker push ${GITHUB_SERVER_URL}/${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}-${SHORT_HASH:0:5}
|
||||
docker push ${REGITRY_HOST}/${GITHUB_REPOSITORY}:${BRANCH_NAME}-latest
|
||||
|
||||
- name: Log out from registry
|
||||
if: always()
|
||||
run: docker logout ${GITHUB_SERVER_URL}
|
||||
run: docker logout ${REGITRY_HOST}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue