updated deploy script + .drone.yml deploy pipeline
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
93bcca7119
commit
ec5b59d000
40
.drone.yml
40
.drone.yml
@ -20,30 +20,24 @@ type: docker
|
|||||||
name: deploy
|
name: deploy
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: rsync-deploy
|
- name: ssh-deploy
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
image: immawanderer/archlinux-hugo:latest
|
image: appleboy/drone-ssh:latest
|
||||||
environment:
|
settings:
|
||||||
HUGO_KEY:
|
host:
|
||||||
from_secret: hugo_key
|
|
||||||
HUGO_PUB:
|
|
||||||
from_secret: hugo_pub
|
|
||||||
HUGO_USER:
|
|
||||||
from_secret: hugo_user
|
|
||||||
HUGO_HOST:
|
|
||||||
from_secret: hugo_host
|
from_secret: hugo_host
|
||||||
HUGO_DIR:
|
username:
|
||||||
from_secret: hugo_dir
|
from_secret: hugo_user
|
||||||
commands:
|
key:
|
||||||
- git submodule init
|
from_secret: hugo_key
|
||||||
- git submodule update
|
password:
|
||||||
- rm -rfv ./public
|
from_secret: hugo_pub
|
||||||
- hugo --gc=true --minify
|
script_stop: true
|
||||||
- echo $HUGO_KEY > ./hugo_deploy
|
script:
|
||||||
- echo $HUGO_PUB > ./hugo_deploy.pub
|
- echo deploy from drone started
|
||||||
- chmod -v 600 ./hugo_deploy
|
- cd ~/dtya
|
||||||
- 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
|
- git pull
|
||||||
- shred -zuv -n 7 ./hugo_deploy*
|
- ./deploy
|
||||||
when:
|
when:
|
||||||
status:
|
status:
|
||||||
- success
|
- success
|
||||||
@ -83,7 +77,7 @@ steps:
|
|||||||
pull: always
|
pull: always
|
||||||
image: appleboy/drone-discord:1.2.4
|
image: appleboy/drone-discord:1.2.4
|
||||||
settings:
|
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:
|
webhook_id:
|
||||||
from_secret: discord_webhook_id
|
from_secret: discord_webhook_id
|
||||||
webhook_token:
|
webhook_token:
|
||||||
|
2
deploy
2
deploy
@ -6,6 +6,6 @@ DIR=public/
|
|||||||
|
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
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
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user