Commit 775b5468 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

feat: add ssh key to committing stage

parent 9059bb17
...@@ -39,12 +39,21 @@ pages: ...@@ -39,12 +39,21 @@ pages:
# This will tag the repository when the version-file changes and the theme successfully builds # This will tag the repository when the version-file changes and the theme successfully builds
auto-tag: auto-tag:
stage: deploy stage: deploy
variables: image: alpine:3.1
VERSION_FILE: "lib/jekyll-theme-lcsb-default.rb"
TARGET_BRANCH: latest
only: only:
changes: changes:
- "lib/jekyll-theme-lcsb-default.rb" - "lib/jekyll-theme-lcsb-default.rb"
before_script:
- 'which ssh-agent || ( apk add --update openssh )'
- eval $(ssh-agent -s)
- echo "$SSHPRIVKEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- 'echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- echo "$KNOWNHOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
variables:
VERSION_FILE: "lib/jekyll-theme-lcsb-default.rb"
TARGET_BRANCH: latest
script: script:
# Make sure that it is on latest, otherwise exit. THIS IS A WORKAROUND, AS HAVING BOTH ONLY AND RULES IS NOT POSSIBLE # Make sure that it is on latest, otherwise exit. THIS IS A WORKAROUND, AS HAVING BOTH ONLY AND RULES IS NOT POSSIBLE
- '[[ "${CI_COMMIT_BRANCH:-1}" == "$TARGET_BRANCH" ]] && echo "On correct branch ($CI_COMMIT_BRANCH)" || exit 0' - '[[ "${CI_COMMIT_BRANCH:-1}" == "$TARGET_BRANCH" ]] && echo "On correct branch ($CI_COMMIT_BRANCH)" || exit 0'
......
# frozen_string_literal: true # frozen_string_literal: true
# Note: keep the format of NUMBER.NUMBER.NUMBER (where NUMBER is [0-9]+) - otherwise Gitlab-CI could fail to detect the version (see .gitlab-ci.yml) and auto-tag job # Note: keep the format of NUMBER.NUMBER.NUMBER (where NUMBER is [0-9]+)
# Otherwise Gitlab-CI could fail to detect the version (see .gitlab-ci.yml) and auto-tag job
module Theme module Theme
VERSION = "0.3.17" VERSION = "0.3.17"
end end
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