when: - event: push branch: master - event: cron branch: master cron: Daily build steps: - name: Hugo build image: alpine:latest commands: - apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community go hugo git - hugo --gc --minify - ls public - name: Deploy image: alpine:latest environment: SSH_HOST: from_secret: SSH_HOST SSH_USER: from_secret: SSH_USER SSH_PATH: from_secret: SSH_PATH SSH_PRIVATE_KEY: from_secret: SSH_PRIVATE_KEY commands: - apk add --no-cache openssh-client rsync - mkdir -p ~/.ssh - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts - rsync -avz public/ $SSH_USER@$SSH_HOST:$SSH_PATH