2023-09-26 16:15:49 +02:00
|
|
|
steps:
|
2022-07-26 14:00:22 +02:00
|
|
|
build:
|
2023-02-11 16:20:56 +01:00
|
|
|
image: gitnet.fr/deblan/mkdocs
|
2023-02-13 18:11:15 +01:00
|
|
|
environment:
|
|
|
|
- SITE_URL=https://doc.murph-project.org/
|
2023-02-13 18:11:41 +01:00
|
|
|
commands: |
|
2023-02-13 18:11:15 +01:00
|
|
|
if [ -n "$SITE_URL" ]; then
|
2023-02-13 18:17:51 +01:00
|
|
|
sed -i "s,# site_url: \"{site_url}\",site_url: \"$SITE_URL\"," mkdocs.yml
|
2023-02-13 18:11:15 +01:00
|
|
|
fi
|
|
|
|
mkdocs build
|
|
|
|
|
2024-01-23 13:14:24 +01:00
|
|
|
commit:
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
2024-01-23 13:19:39 +01:00
|
|
|
- git config --global user.email ci@gitnet.fr
|
|
|
|
- git config --global user.name CI
|
2024-01-23 13:19:09 +01:00
|
|
|
- git commit -m build -a
|
2024-01-23 13:14:24 +01:00
|
|
|
- git fetch --no-tags origin +refs/heads/pages
|
2024-01-23 13:31:55 +01:00
|
|
|
- git remote add upstream git@gitnet.fr:murph/murph-doc.git
|
2024-01-23 13:14:24 +01:00
|
|
|
- git switch pages
|
|
|
|
- mv site /tmp/
|
|
|
|
- rm * -fr
|
|
|
|
- mv /tmp/site/* .
|
2024-01-23 13:30:08 +01:00
|
|
|
- mkdir ~/.ssh
|
2024-01-23 13:29:30 +01:00
|
|
|
- echo "$SSH_KEY" > ~/.ssh/id_rsa
|
|
|
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
|
|
|
- chmod -R 400 ~/.ssh
|
2024-01-23 13:14:24 +01:00
|
|
|
- git add .
|
|
|
|
- git commit -m "Build ${CI_BUILD_NUMBER}"
|
2024-01-23 13:31:55 +01:00
|
|
|
- git push upstream pages
|
2024-01-23 13:14:24 +01:00
|
|
|
|
2024-01-23 13:28:19 +01:00
|
|
|
# push:
|
|
|
|
# image: appleboy/drone-git-push
|
|
|
|
# commands:
|
|
|
|
# settings:
|
|
|
|
# branch: pages
|
|
|
|
# remote: git@gitnet.fr:murph/murph-doc.git
|
|
|
|
# force: false
|
|
|
|
# commit: false
|
|
|
|
# ssh_key:
|
|
|
|
# from_secret: ssh_key
|
2024-01-23 13:01:02 +01:00
|
|
|
|
|
|
|
#deploy:
|
|
|
|
# image: eeacms/rsync
|
|
|
|
# secrets: [ssh_user_host, ssh_priv_key]
|
|
|
|
# commands:
|
|
|
|
# - mkdir "$HOME/.ssh"
|
|
|
|
# - echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519"
|
|
|
|
# - chmod 700 "$HOME/.ssh"
|
|
|
|
# - chmod 600 "$HOME/.ssh/id_ed25519"
|
|
|
|
# - rsync -e "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --delete ./site/ "$SSH_USER_HOST:web/"
|
|
|
|
# when:
|
|
|
|
# branch:
|
|
|
|
# - master
|