fixed runner again
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 0s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 0s
This commit is contained in:
@@ -13,12 +13,33 @@ jobs:
|
|||||||
REGISTRY: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu
|
REGISTRY: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu
|
||||||
IMAGE_REPO: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/j.r/template-code-location
|
IMAGE_REPO: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/j.r/template-code-location
|
||||||
steps:
|
steps:
|
||||||
- name: Validate workspace
|
- name: Checkout repository (shell)
|
||||||
run: |
|
run: |
|
||||||
pwd
|
REPO_DIR="repo"
|
||||||
ls -la
|
SERVER_URL="${GITHUB_SERVER_URL:-$GITEA_SERVER_URL}"
|
||||||
if [ ! -f "Dockerfile" ]; then
|
TOKEN="${GITHUB_TOKEN:-$GITEA_TOKEN}"
|
||||||
echo "Dockerfile not found in workspace. Configure runner to provide repository checkout."
|
REF_NAME="${GITHUB_REF_NAME}"
|
||||||
|
if [ -z "${REF_NAME}" ]; then
|
||||||
|
REF_NAME="${GITHUB_REF#refs/heads/}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${SERVER_URL}" ]; then
|
||||||
|
echo "Missing GITHUB_SERVER_URL/GITEA_SERVER_URL"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${TOKEN}" ]; then
|
||||||
|
echo "Missing GITHUB_TOKEN/GITEA_TOKEN; cannot clone private repository"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf "${REPO_DIR}"
|
||||||
|
git clone --depth 1 --branch "${REF_NAME}" \
|
||||||
|
"https://oauth2:${TOKEN}@${SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" \
|
||||||
|
"${REPO_DIR}"
|
||||||
|
|
||||||
|
if [ ! -f "${REPO_DIR}/Dockerfile" ]; then
|
||||||
|
echo "Dockerfile not found after clone"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -38,6 +59,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
COMMIT_SHA="${GITHUB_SHA:-$GITEA_SHA}"
|
COMMIT_SHA="${GITHUB_SHA:-$GITEA_SHA}"
|
||||||
SHORT_SHA="$(echo "${COMMIT_SHA}" | cut -c1-12)"
|
SHORT_SHA="$(echo "${COMMIT_SHA}" | cut -c1-12)"
|
||||||
|
cd repo
|
||||||
docker build \
|
docker build \
|
||||||
-t "${IMAGE_REPO}:latest" \
|
-t "${IMAGE_REPO}:latest" \
|
||||||
-t "${IMAGE_REPO}:${SHORT_SHA}" \
|
-t "${IMAGE_REPO}:${SHORT_SHA}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user