Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
fc6bd36d2f | |||
6fdf99b0f3 | |||
71f107e2ee | |||
07a3b7821a | |||
7ef0bd900e | |||
050b220e7b | |||
27fa3c7818 | |||
5e86455eb4 | |||
2bbdbaece5 |
55
.drone.yml
55
.drone.yml
@ -1,32 +1,33 @@
|
|||||||
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
name: default
|
name: default
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: Budowanie dokcumentacji
|
||||||
image: plugins/hugo
|
image: paramah/hugo-deploy
|
||||||
settings:
|
commands:
|
||||||
pull: always
|
- npm install -g postcss-cli
|
||||||
url:
|
- npm install postcss autoprefixer
|
||||||
from_secret: domain
|
- git submodule update --init --recursive
|
||||||
validate: true
|
- hugo --destination /drone/src/build
|
||||||
|
- minify -r -o /drone/src/build /drone/src/build
|
||||||
|
|
||||||
- name: deploy
|
- name: Deploy dokumentacji
|
||||||
image: appleboy/drone-scp
|
image: paramah/hugo-deploy
|
||||||
settings:
|
commands:
|
||||||
host:
|
- eval `ssh-agent -s`
|
||||||
from_secret: ssh_host
|
- echo "$SSH_KEY" | ssh-add -
|
||||||
target:
|
- mkdir -p ~/.ssh
|
||||||
from_secret: site_path
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||||
source: public/*
|
- rsync -rv -e "ssh -p 65522" /drone/src/build/ $SSH_URI:$DEST --checksum
|
||||||
username:
|
environment:
|
||||||
from_secret: ssh_username
|
SSH_KEY:
|
||||||
password:
|
from_secret: drone_ssh_key
|
||||||
from_secret: ssh_password
|
SSH_URI:
|
||||||
port:
|
from_secret: ssh_uri
|
||||||
from_secret: ssh_port
|
DEST:
|
||||||
when:
|
from_secret: destination
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
exclude:
|
|
||||||
- pull_request
|
|
||||||
|
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/public/
|
||||||
|
/resources/_gen/
|
||||||
|
hugo_stats.json
|
||||||
|
public/
|
||||||
|
resources/
|
||||||
|
node_modules/
|
34
DOCSY_DEPLOY.md
Normal file
34
DOCSY_DEPLOY.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Docsy hugo deploy
|
||||||
|
|
||||||
|
Skrypt umożliwia szybki automatyczny deploy dokumentacji opartej o [docsy](https://www.docsy.dev/docs/).
|
||||||
|
|
||||||
|
# Zawiera
|
||||||
|
|
||||||
|
`.gitignore` dla hugo
|
||||||
|
`init.sh` skrypt inicjujący repozytorium dla docsy (subrepo dla tematu)
|
||||||
|
`.drone.yml` skrypt do automatycznego deploymentu
|
||||||
|
|
||||||
|
# Wymagania
|
||||||
|
|
||||||
|
- [drone.io cli](https://docs.drone.io/cli/install/)
|
||||||
|
- [hugo](https://gohugo.io/getting-started/installing/)
|
||||||
|
|
||||||
|
# Użycie
|
||||||
|
|
||||||
|
Musimy aktywować repozytorium na naszym drone.io
|
||||||
|
|
||||||
|
```
|
||||||
|
cat ${args[0]} |awk -F\= '{system("drone secret add --repository='${args[1]}' --name="$1 " --data="$2)}'
|
||||||
|
```
|
||||||
|
|
||||||
|
Wymagane zmienne:
|
||||||
|
|
||||||
|
```
|
||||||
|
domain=
|
||||||
|
site_path=
|
||||||
|
ssh_host=
|
||||||
|
ssh_username=
|
||||||
|
ssh_password=
|
||||||
|
ssh_port=
|
||||||
|
```
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
# Drone hugo
|
|
||||||
|
|
||||||
## Użycie
|
|
||||||
|
|
||||||
```
|
|
||||||
cat ${args[0]} |awk -F\= '{system("drone secret add --repository='${args[1]}' --name="$1 " --data="$2)}'
|
|
||||||
```
|
|
||||||
|
|
||||||
Wymagane zmienne:
|
|
||||||
|
|
||||||
```
|
|
||||||
domain=
|
|
||||||
site_path=
|
|
||||||
ssh_host=
|
|
||||||
ssh_username=
|
|
||||||
ssh_password=
|
|
||||||
ssh_port=
|
|
||||||
```
|
|
||||||
|
|
34
init_docsy.sh
Executable file
34
init_docsy.sh
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# Helper functions
|
||||||
|
#
|
||||||
|
declare -i term_width=120
|
||||||
|
|
||||||
|
h1() {
|
||||||
|
declare border padding text
|
||||||
|
border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m'
|
||||||
|
padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))"
|
||||||
|
text="\\e[1m$*\\e[0m"
|
||||||
|
echo -e "$border"
|
||||||
|
echo -e "${padding}${text}${padding}"
|
||||||
|
echo -e "$border"
|
||||||
|
}
|
||||||
|
|
||||||
|
h2() {
|
||||||
|
printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 "Inicjalizacja struktury hugo"
|
||||||
|
hugo new site --force ./
|
||||||
|
h1 "Inicjalizacja repozytorium git"
|
||||||
|
git init
|
||||||
|
h2 "Inicjalizacja submodułu z docsy"
|
||||||
|
git submodule add https://github.com/google/docsy.git themes/docsy
|
||||||
|
echo 'theme = "docsy"' >> config.toml
|
||||||
|
git submodule update --init --recursive
|
||||||
|
h1 "Obsłga mermaid"
|
||||||
|
mv tmp_layouts layouts
|
||||||
|
h1 "Czyszczenie repozytorium"
|
||||||
|
rm init_docsy.sh
|
||||||
|
|
9
tmp_layouts/shortcodes/mermaid.html
Normal file
9
tmp_layouts/shortcodes/mermaid.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!-- MermaidJS support -->
|
||||||
|
<script async src="https://unpkg.com/mermaid@8.7.0/dist/mermaid.min.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="mermaid">
|
||||||
|
{{.Inner}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user