murph-doc/.woodpecker.yml
Simon Vieille 5d7b3bc0ea
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
add ci to deploy on gitnet.page
2024-01-23 13:29:30 +01:00

53 lines
1.5 KiB
YAML

steps:
build:
image: gitnet.fr/deblan/mkdocs
environment:
- SITE_URL=https://doc.murph-project.org/
commands: |
if [ -n "$SITE_URL" ]; then
sed -i "s,# site_url: \"{site_url}\",site_url: \"$SITE_URL\"," mkdocs.yml
fi
mkdocs build
commit:
image: alpine/git
commands:
- git config --global user.email ci@gitnet.fr
- git config --global user.name CI
- git commit -m build -a
- git fetch --no-tags origin +refs/heads/pages
- git switch pages
- mv site /tmp/
- rm * -fr
- mv /tmp/site/* .
- echo "$SSH_KEY" > ~/.ssh/id_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- chmod -R 400 ~/.ssh
- git add .
- git commit -m "Build ${CI_BUILD_NUMBER}"
- git push origin pages
# 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
#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