Skip to content
Snippets Groups Projects
Verified Commit ac89c19b authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

yml commands to commit back the generated index

parent 74e87455
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,31 @@ prepare:index: ...@@ -25,6 +25,31 @@ prepare:index:
paths: paths:
- .tmp - .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 # build
# ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------
...@@ -55,9 +80,6 @@ build:pages: ...@@ -55,9 +80,6 @@ build:pages:
# Display, which configuration is used # Display, which configuration is used
- 'echo "Configuration: " && cat ".ci/_config_$CI_COMMIT_REF_NAME.yml"' - 'echo "Configuration: " && cat ".ci/_config_$CI_COMMIT_REF_NAME.yml"'
# retrieve index from previous stage
- cp .tmp/index.md .
# Run Jekyll with custom configuration # Run Jekyll with custom configuration
- bundle exec jekyll build -d build --config "_config.yml,.ci/_config_$CI_COMMIT_REF_NAME.yml" - bundle exec jekyll build -d build --config "_config.yml,.ci/_config_$CI_COMMIT_REF_NAME.yml"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment