Verified Commit ac89c19b authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

yml commands to commit back the generated index

parent 74e87455
Pipeline #30270 failed with stages
in 3 minutes and 36 seconds
......@@ -25,6 +25,31 @@ prepare:index:
paths:
- .tmp
prepare:commitIndex:
image:
name: alpine/git:latest
entrypoint: [""]
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_MESSAGE !~ /tmpBranch/ && $CI_COMMIT_MESSAGE !~ /Update index/'
before_script:
- git fetch --all
- url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
- git remote set-url origin "https://$GIT_ACCESS_USER:$GIT_ACCESS_TOKEN@${url_host}"
- git config user.name $GIT_ACCESS_USER
- git config user.email $GIT_ACCESS_EMAIL
script:
- cp .tmp/index.md .
- git branch -D tmpBranch || true
- git checkout -b tmpBranch
- git add --all
- git commit -m "Update index"
- git checkout $CI_COMMIT_REF_NAME
- git pull origin $CI_COMMIT_REF_NAME
- git merge tmpBranch --ff
- git push origin $CI_COMMIT_REF_NAME || true
- git branch -D tmpBranch
# build
# ------------------------------------------------------------------------------------
......@@ -55,9 +80,6 @@ build:pages:
# Display, which configuration is used
- 'echo "Configuration: " && cat ".ci/_config_$CI_COMMIT_REF_NAME.yml"'
# retrieve index from previous stage
- cp .tmp/index.md .
# Run Jekyll with custom configuration
- bundle exec jekyll build -d build --config "_config.yml,.ci/_config_$CI_COMMIT_REF_NAME.yml"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment