Remove redundant registry retrieval step and use environment variable directly in Docker workflow
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
This commit is contained in:
@@ -21,21 +21,6 @@ jobs:
|
||||
packages: write
|
||||
|
||||
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
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -48,7 +33,7 @@ jobs:
|
||||
- name: Log in to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ steps.registry.outputs.registry }}
|
||||
registry: ${{ vars.REGISTRY }}
|
||||
username: ${{ vars.USERNAME }}
|
||||
password: ${{ secrets.PASS }}
|
||||
|
||||
@@ -56,7 +41,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ steps.registry.outputs.registry }}/${{ vars.USERNAME }}/${{ env.IMAGE_NAME }}
|
||||
images: ${{ vars.REGISTRY }}/${{ vars.USERNAME }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
# Only tag with version and latest on tag push
|
||||
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
|
||||
Reference in New Issue
Block a user