-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
33 lines (32 loc) · 1.38 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
stages:
- update_docs
update_tutorials:
stage: update_docs
image: alpine:latest
before_script:
- apk add --no-cache git
- git config user.name $AMS_DATA_USER
- git config --global user.email "noreply@coinmetrics.io"
script:
- git clone https://$AMS_DATA_USER:$AMS_DATA_TOKEN@gitlab.com/coinmetrics/front-end/knowledge-base.git
- git clone https://$AMS_DATA_USER:$AMS_DATA_TOKEN@gitlab.com/coinmetrics/research/cm_demo_assets.git
- cp -r cm_demo_assets/markdowns/*.md knowledge-base/docs/tutorials/
- find cm_demo_assets/notebooks -name "*.pdf" -exec cp -r --parents {} knowledge-base/docs/.gitbooks/assets/ \;
- find cm_demo_assets/notebooks -name "*.ipynb" -exec cp -r --parents {} knowledge-base/docs/.gitbooks/assets/ \;
- cd knowledge-base
- BRANCH_NAME="update-demo-docs-$(date +%Y%m%d-%H%M%S)"
- git checkout -b $BRANCH_NAME
- git add docs/tutorials/*.md
- |
if git diff --staged --quiet; then
echo "No changes detected. Skipping merge request creation."
else
echo "Changes detected. Creating merge request."
git commit -m "Update tutorial docs from cm_demo_assets"
git push -o merge_request.create -o merge_request.target=master -o merge_request.title="Update tutorial docs from cm_demo_assets" origin $BRANCH_NAME
fi
when: manual
tags:
- coinmetrics-build-runner
- linux
- docker