kind: pipeline type: docker name: build-and-deploy steps: - name: build image: klakegg/hugo:latest volumes: - name: build path: $HOME/build commands: - hugo - cp -rv public $HOME/build - name: deploy image: alpine/git:latest volumes: - name: build path: $HOME/build environment: SSH_USER: from_secret: ssh_user SSH_HOST: from_secret: ssh_host SSH_PORT: from_secret: ssh_port SSH_KEY: from_secret: ssh_key commands: - mkdir $HOME/.ssh - echo "$SSH_KEY" > $HOME/.ssh/id_ed25519 - chmod 600 $HOME/.ssh/id_ed25519 - scp -o "StrictHostKeyChecking no" -P ${SSH_PORT} -r $HOME/build/public ${SSH_USER}@${SSH_HOST}:docker/nginx/website volumes: - name: build temp: {}