Remove redundant registry retrieval step and use environment variable directly in Docker workflow
Some checks failed
Build and publish Docker image / build-and-push (push) Failing after 4m37s
Some checks failed
Build and publish Docker image / build-and-push (push) Failing after 4m37s
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
This commit is contained in:
@@ -21,21 +21,6 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Get Registry
|
|
||||||
id: registry
|
|
||||||
run: |
|
|
||||||
# Use RUNNER_REGISTRY environment variable
|
|
||||||
if [ ! -z "${RUNNER_REGISTRY}" ]; then
|
|
||||||
REGISTRY="${RUNNER_REGISTRY}"
|
|
||||||
else
|
|
||||||
echo "ERROR: RUNNER_REGISTRY environment variable not set"
|
|
||||||
echo "Please add RUNNER_REGISTRY to your runner's environment variables"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "registry=${REGISTRY}" >> $GITHUB_OUTPUT
|
|
||||||
echo "Using registry: ${REGISTRY}"
|
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -48,7 +33,7 @@ jobs:
|
|||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ steps.registry.outputs.registry }}
|
registry: ${{ vars.REGISTRY }}
|
||||||
username: ${{ vars.USERNAME }}
|
username: ${{ vars.USERNAME }}
|
||||||
password: ${{ secrets.PASS }}
|
password: ${{ secrets.PASS }}
|
||||||
|
|
||||||
@@ -56,7 +41,7 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ steps.registry.outputs.registry }}/${{ vars.USERNAME }}/${{ env.IMAGE_NAME }}
|
images: ${{ vars.REGISTRY }}/${{ vars.USERNAME }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
# Only tag with version and latest on tag push
|
# Only tag with version and latest on tag push
|
||||||
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user