Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
991a221b20 | |||
3be2bf2e0b | |||
1835fb7b2d |
58
.drone.yml
58
.drone.yml
@ -1,33 +1,35 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
|
||||
steps:
|
||||
- name: Budowanie strony
|
||||
image: paramah/hugo-deploy
|
||||
commands:
|
||||
- npm install -D --save autoprefixer
|
||||
- npm install -D --save postcss-cli
|
||||
- git submodule update --init --recursive
|
||||
- hugo --destination /drone/src/build
|
||||
- minify -r -o /drone/src/build /drone/src/build
|
||||
- name: terratest
|
||||
image: plugins/docker
|
||||
settings:
|
||||
username:
|
||||
from_secret: hub_username
|
||||
password:
|
||||
from_secret: hub_password
|
||||
repo:
|
||||
from_secret: hub_repo
|
||||
tags: latest
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
|
||||
- name: Deploy strony
|
||||
image: paramah/hugo-deploy
|
||||
commands:
|
||||
- eval `ssh-agent -s`
|
||||
- echo "$SSH_KEY" | ssh-add -
|
||||
- mkdir -p ~/.ssh
|
||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
- rsync -rv -e "ssh -p 65522" /drone/src/build/ $SSH_URI:$DEST --checksum
|
||||
environment:
|
||||
SSH_KEY:
|
||||
from_secret: drone_ssh_key
|
||||
SSH_URI:
|
||||
from_secret: ssh_uri
|
||||
DEST:
|
||||
from_secret: destination
|
||||
- name: notify
|
||||
image: appleboy/drone-telegram
|
||||
settings:
|
||||
token:
|
||||
from_secret: telegram_bot_token
|
||||
to:
|
||||
from_secret: telegram_group_id
|
||||
message: >
|
||||
{{#success build.status}}
|
||||
build {{build.link}} triggerd by {{commit.link}} from {{commit.author}} succeeded
|
||||
{{else}}
|
||||
build {{build.link}} triggerd by {{commit.link}} from {{commit.author}} failed
|
||||
{{/success}}
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Drone hugo
|
||||
# Drone docker deploy
|
||||
|
||||
## Użycie
|
||||
|
||||
@ -9,11 +9,11 @@ cat ${args[0]} |awk -F\= '{system("drone secret add --repository='${args[1]}' --
|
||||
Wymagane zmienne:
|
||||
|
||||
```
|
||||
domain=
|
||||
site_path=
|
||||
ssh_host=
|
||||
ssh_username=
|
||||
ssh_password=
|
||||
ssh_port=
|
||||
hub_username=
|
||||
hub_password=
|
||||
hub_repo=
|
||||
telegram_bot_token=
|
||||
telegram_group_id=
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user