70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
clone:
|
|
git:
|
|
image: woodpeckerci/plugin-git
|
|
settings:
|
|
lfs: true
|
|
recursive: true
|
|
branch: master
|
|
|
|
pipeline:
|
|
build:
|
|
image: klakegg/hugo:ext-alpine-ci
|
|
|
|
# pipeline:
|
|
build-deploy-image:
|
|
image: docker
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
commands:
|
|
- cd .docker/rsync_deploy; docker build -t internal/rsync_deploy:latest .
|
|
|
|
# pipeline:
|
|
deploy:
|
|
image: internal/rsync_deploy:latest
|
|
commands:
|
|
- mkdir /root/.ssh
|
|
- chmod 700 /root/.ssh
|
|
- echo "$SSH_KEY_BASE64" | base64 -d >/root/.ssh/id_ecdsa
|
|
- chmod 600 /root/.ssh/id_ecdsa
|
|
- rsync -az -e 'ssh -p 479 -i /root/.ssh/id_ecdsa -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o StrictHostKeyChecking=no' public/ root@polarolouis.fr:/opt/services/blog/webpages
|
|
secrets:
|
|
- ssh_key_base64
|
|
|
|
notify-on-success:
|
|
image: plugins/webhook
|
|
settings:
|
|
urls:
|
|
from_secret: gotify_url_tokenized
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"extras": {
|
|
"client::display": {
|
|
"contentType": "text/markdown"
|
|
}
|
|
},
|
|
"title": "Building : ${CI_REPO}",
|
|
"message": "Succes on build [${CI_BUILD_NUMBER}](${CI_BUILD_LINK}) for commit ${CI_COMMIT_SHA}",
|
|
"priority": 5
|
|
}
|
|
|
|
notify-on-failure:
|
|
image: plugins/webhook
|
|
settings:
|
|
urls:
|
|
from_secret: gotify_url_tokenized
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"extras": {
|
|
"client::display": {
|
|
"contentType": "text/markdown"
|
|
}
|
|
},
|
|
"title": "Building : ${CI_REPO}",
|
|
"message": "Failed on build [${CI_BUILD_NUMBER}](${CI_BUILD_LINK}) for commit ${CI_COMMIT_SHA}",
|
|
"priority": 5
|
|
}
|
|
when:
|
|
status:
|
|
- failure
|