From 55888d656c07f2ea91fb10862a642389e8601e95 Mon Sep 17 00:00:00 2001 From: ahmza Date: Fri, 21 Jun 2024 23:35:24 +0100 Subject: [PATCH] move to private repo --- .gitlab-ci.yml | 2 +- Dockerfile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a3fcf9..0afa212 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,6 @@ build: script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker buildx create --use - - docker buildx build --build-arg --no-cache --platform linux/arm64,linux/amd64 -t $IMAGE_TAG --push . + - docker buildx build --build-arg GITLAB_TOKEN=$GITLAB_TOKEN --no-cache --platform linux/arm64,linux/amd64 -t $IMAGE_TAG --push . rules: - if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "staging") && $BUILD == "1" diff --git a/Dockerfile b/Dockerfile index 11edcd3..74c1011 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # use the classic alpine image FROM alpine as Builder +ARG GITLAB_TOKEN # install curl and git RUN apk add --update curl git @@ -8,7 +9,7 @@ RUN apk add --update curl git RUN curl -L https://github.com/gohugoio/hugo/releases/download/v0.121.1/hugo_0.121.1_linux-arm64.tar.gz > hugo.tar.gz && tar -zxf hugo.tar.gz && mv hugo /usr/local/bin # clone the blog repository as well as the theme submodule -RUN git clone --recurse-submodules https://gitlab.com/AHMZA/blog.git +RUN git clone --recurse-submodules https://oauth2:$GITLAB_TOKEN@gitlab.com/AHMZA/blog.git # set blog (the folder we just cloned) as the current DIR WORKDIR blog