prueba 3
This commit is contained in:
parent
ea664b0c70
commit
1617974db1
2 changed files with 34 additions and 14 deletions
|
|
@ -1,7 +1,10 @@
|
|||
name: Deploy HTML
|
||||
name: MD a HTML y deploy Apache
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
|
@ -10,10 +13,11 @@ jobs:
|
|||
image: ubuntu:22.04
|
||||
volumes:
|
||||
- /srv/devops/data/apache/htdocs:/output
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Convertir y desplegar
|
||||
- name: Convertir y publicar
|
||||
run: |
|
||||
chmod +x convertir.sh
|
||||
./convertir.sh
|
||||
36
convertir.sh
36
convertir.sh
|
|
@ -1,12 +1,28 @@
|
|||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
+set -euo pipefail
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
- for MD in $(ls *.md)
|
||||
+ for md in *.md; do
|
||||
+ [ -f "$md" ] || continue
|
||||
dependencies(){
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq pandoc
|
||||
}
|
||||
|
||||
- echo "USAR scp O ftp O CUALQUIER OTRA COSA PARA SUBIR LOS HTML: $HTML"
|
||||
- cat $HTML
|
||||
+ cp "$html" /output/
|
||||
+ echo "https://portaljack.freeddns.org/${html}"
|
||||
convert_to_html(){
|
||||
for md in *.md; do
|
||||
[ -f "$md" ] || continue
|
||||
filename="${md%.*}"
|
||||
pandoc -o "$filename.html" "$md"
|
||||
echo "Convertido: $md -> $filename.html"
|
||||
done
|
||||
}
|
||||
|
||||
upload(){
|
||||
for html in *.html; do
|
||||
[ -f "$html" ] || continue
|
||||
cp "$html" /output/
|
||||
echo "✅ Publicado: $html"
|
||||
done
|
||||
}
|
||||
|
||||
dependencies
|
||||
convert_to_html
|
||||
upload
|
||||
Loading…
Reference in a new issue