60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
---
|
|
kind: pipeline
|
|
name: build
|
|
|
|
steps:
|
|
- name: markdown lint
|
|
image: pipelinecomponents/markdownlint:latest
|
|
commands:
|
|
- mdl .
|
|
|
|
- name: build pelican
|
|
image: apihackers/pelican
|
|
commands:
|
|
- pelican content -o output -s pelicanconf.py
|
|
|
|
|
|
---
|
|
deploy_commands:
|
|
- &deploy_commands
|
|
commands:
|
|
- echo "deploy $DEPLOY_USER@$DEPLOY_HOST"
|
|
- echo "$DEPLOY_KEY" | sed 's/!/\n/g' > deploy_key
|
|
- chmod 0600 deploy_key
|
|
- ssh -i deploy_key -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST rm -Rf ${DEPLOY_DIR}/output/
|
|
- scp -r -i deploy_key -o StrictHostKeyChecking=no output $DEPLOY_USER@$DEPLOY_HOST:${DEPLOY_DIR}
|
|
|
|
kind: pipeline
|
|
name: deploy
|
|
- name: deploy staging
|
|
image: kroniak/ssh-client
|
|
environment:
|
|
DEPLOY_USER:
|
|
from_secret: deploy_user
|
|
DEPLOY_HOST:
|
|
from_secret: deploy_host
|
|
DEPLOY_KEY:
|
|
from_secret: deploy_key
|
|
DEPLOY_DIR: /srv/http/blog-lan
|
|
<<: *deploy_commands
|
|
when:
|
|
branch:
|
|
exclude:
|
|
- master
|
|
|
|
- name: deploy live
|
|
image: kroniak/ssh-client
|
|
environment:
|
|
DEPLOY_USER:
|
|
from_secret: deploy_user
|
|
DEPLOY_HOST:
|
|
from_secret: deploy_host
|
|
DEPLOY_KEY:
|
|
from_secret: deploy_key
|
|
DEPLOY_DIR: /srv/http/blog
|
|
commands:
|
|
<<: *deploy_commands
|
|
when:
|
|
branch:
|
|
include:
|
|
- master
|