Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
howto-cards
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marie Fossepre
howto-cards
Commits
ac89c19b
Verified
Commit
ac89c19b
authored
4 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
yml commands to commit back the generated index
parent
74e87455
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+25
-3
25 additions, 3 deletions
.gitlab-ci.yml
with
25 additions
and
3 deletions
.gitlab-ci.yml
+
25
−
3
View file @
ac89c19b
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment