From 8c16444ff864bfd1311ed25c041a53ce21971633 Mon Sep 17 00:00:00 2001 From: Vojdan Kjorveziroski <vojdan.kjorveziroski@finki.ukim.mk> Date: Thu, 25 Apr 2024 12:30:25 +0000 Subject: [PATCH] Resolve "Configure CI" --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9fda2bf --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,36 @@ +stages: + - build + - publish + +build_website: + stage: build + image: python:3.9-bookworm + before_script: + - pip install -r requirements.txt + script: + - mkdocs build --strict + artifacts: + paths: + - "site/" + expire_in: "30 minutes" + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run for all changes to the default branch + +copy_static_files: + stage: publish + image: instrumentisto/rsync-ssh:alpine + # image: python:3.9-bookworm + before_script: + - eval $(ssh-agent -s) + - chmod 400 "$SSH_PRIVATE_KEY" + - ssh-add "$SSH_PRIVATE_KEY" + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - rsync -ah --delete --progress site/ $SSH_HOST:/ + dependencies: + - "build_website" + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run for all changes to the default branch -- GitLab