From f92b2cf92284bec08b8a3da02f62e0c0d8a7bb1a Mon Sep 17 00:00:00 2001 From: Benoit Martin Date: Thu, 5 Dec 2024 04:46:12 +0100 Subject: [PATCH] add documentation from github's main branch (#2) --- .github/actions/deploy/Dockerfile | 2 +- .github/actions/deploy/entrypoint.sh | 89 ++++++++++++++++++++++++---- 2 files changed, 78 insertions(+), 13 deletions(-) diff --git a/.github/actions/deploy/Dockerfile b/.github/actions/deploy/Dockerfile index f55be607..90ec8f00 100644 --- a/.github/actions/deploy/Dockerfile +++ b/.github/actions/deploy/Dockerfile @@ -3,6 +3,6 @@ FROM alpine:3.10 COPY entrypoint.sh /entrypoint.sh -RUN [ "apk", "add", "bash", "curl" ] +RUN [ "apk", "add", "bash", "curl", "jq" ] ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/deploy/entrypoint.sh b/.github/actions/deploy/entrypoint.sh index a2439fb2..92abb26a 100755 --- a/.github/actions/deploy/entrypoint.sh +++ b/.github/actions/deploy/entrypoint.sh @@ -17,6 +17,14 @@ GITLAB_URL="$2" PROJECT_NAME="$3" +set +x +if [ -z ${CI_PAGES_TOKEN} ] +then + echo "CI_PAGES_TOKEN is unset" + exit 1 +fi +set -ex + cd "$(mktemp -t -d WEB_DEPLOY.tmdir.XXXXXXXXXXXX || exit 1)" WORK_DIR="${PWD}" trap "cd '${DEPLOY_DIR}'; rm -rf '${WORK_DIR}'" EXIT @@ -35,6 +43,10 @@ cat << EOF > "${WORK_DIR}/public/index.html" EOF