updated deploy script + .drone.yml deploy pipeline
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
surtur 2020-03-10 03:49:49 +01:00
parent 93bcca7119
commit ec5b59d000
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 18 additions and 24 deletions

View File

@ -20,30 +20,24 @@ type: docker
name: deploy
steps:
- name: rsync-deploy
- name: ssh-deploy
pull: if-not-exists
image: immawanderer/archlinux-hugo:latest
environment:
HUGO_KEY:
from_secret: hugo_key
HUGO_PUB:
from_secret: hugo_pub
HUGO_USER:
from_secret: hugo_user
HUGO_HOST:
image: appleboy/drone-ssh:latest
settings:
host:
from_secret: hugo_host
HUGO_DIR:
from_secret: hugo_dir
commands:
- git submodule init
- git submodule update
- rm -rfv ./public
- hugo --gc=true --minify
- echo $HUGO_KEY > ./hugo_deploy
- echo $HUGO_PUB > ./hugo_deploy.pub
- chmod -v 600 ./hugo_deploy
- rsync -av -e "ssh -vv -o KexAlgorithms=curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256 -o PreferredAuthentications=publickey -o PubkeyAuthentication=yes -o PasswordAuthentication=no -c aes256-ctr,aes256-cbc -o StrictHostKeyChecking=no -i ./hugo_deploy" --delete public/ $HUGO_USER@$HUGO_HOST:$HUGO_DIR
- shred -zuv -n 7 ./hugo_deploy*
username:
from_secret: hugo_user
key:
from_secret: hugo_key
password:
from_secret: hugo_pub
script_stop: true
script:
- echo deploy from drone started
- cd ~/dtya
- git pull
- ./deploy
when:
status:
- success
@ -83,7 +77,7 @@ steps:
pull: always
image: appleboy/drone-discord:1.2.4
settings:
message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\ncommit `${DRONE_COMMIT_SHA:0:7}` by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n{{ build.link }}\n\n {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\ncommit `${DRONE_COMMIT_SHA:0:7}` by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n{{ build.link }}\n\n {{/success}}\n"
message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\ncommit `${DRONE_COMMIT_SHA:0:7}` by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n{{ build.link }}\n\n{{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\ncommit `${DRONE_COMMIT_SHA:0:7}` by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n{{ build.link }}\n\n{{/success}}\n"
webhook_id:
from_secret: discord_webhook_id
webhook_token:

2
deploy
View File

@ -6,6 +6,6 @@ DIR=public/
git submodule init
git submodule update
../hugo --gc=true && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR}
../hugo --gc=true --minify && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR}
exit 0