Commit 625e6b6f authored by Melroy van den Berg's avatar Melroy van den Berg
Browse files

Add gitlab ci

parent 813ba3fb
Pipeline #3656 failed with stages
in 13 seconds
image: "python:3-slim"
cache:
paths:
- .cache/pip
stages:
- pull
- build
- deploy
build:
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
stage: build
before_script:
- pip install -r requirements.txt
script:
- make html
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
artifacts:
expire_in: 1 month
paths:
- _build/html
deploy:
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule" && $CI_PROJECT_NAMESPACE == "bitcoin-dot-org" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
stage: deploy
image: instrumentisto/rsync-ssh:latest
before_script:
# Run ssh-agent
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- echo "${SSH_PRIVATE_KEY}" | base64 -d | ssh-add - > /dev/null
- echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
script:
- rsync -azhv --delete _build/html/ "${SSH_USER_HOST_LOCATION}"
repo_pull_sync:
stage: pull
image: danger89/repo_mirror_pull:latest
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: $REMOTE_URL
- if: $REMOTE_BRANCH
- if: $ACCESS_TOKEN
before_script:
- git config --global user.name "${GITLAB_USER_NAME}"
- git config --global user.email "${GITLAB_USER_EMAIL}"
script:
- git checkout $CI_DEFAULT_BRANCH
- git pull
- git remote remove upstream || true
- git remote add upstream $REMOTE_URL
- git fetch upstream
- git merge upstream/$REMOTE_BRANCH
- git push "https://${GITLAB_USER_LOGIN}:${ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_DEFAULT_BRANCH}"
Supports Markdown
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