Skip to content

Commit 2b4cc7e

Browse files
authored
Update deploy.yml
1 parent 52d4415 commit 2b4cc7e

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Impressum with Private Address
1+
name: Build Impressum with Address as Image
22

33
on:
44
push:
@@ -12,20 +12,28 @@ jobs:
1212
- name: Checkout Repository
1313
uses: actions/checkout@v3
1414

15-
- name: Install pandoc
16-
run: sudo apt-get install -y pandoc
15+
- name: Install dependencies
16+
run: sudo apt-get update && sudo apt-get install -y imagemagick pandoc gettext
1717

18-
- name: Create build folder
18+
- name: Create build directory
1919
run: mkdir -p site
2020

21-
- name: Replace placeholder and convert to HTML
21+
- name: Create image from address
2222
env:
2323
ADDRESS: ${{ secrets.ADDRESS_PLAIN }}
2424
run: |
25-
# sed "s/{{PRIVATE_ADDRESS}}/$ADDRESS/" impressum.md > site/impressum.md
25+
echo "$ADDRESS" | convert -background white -fill black -font Helvetica -pointsize 16 text:- address.png
26+
base64 address.png > address.b64
27+
28+
- name: Replace placeholder with Base64 image
29+
run: |
30+
IMAGE_DATA=$(cat address.b64 | tr -d '\n')
31+
sed "s#\${ADDRESS_IMAGE}#<img src='data:image/png;base64,${IMAGE_DATA}' alt='Adresse'>#" impressum.md > site/impressum.md
32+
pandoc site/impressum.md -f markdown -t html -o site/impressum.html
2633
2734
- name: Deploy to GitHub Pages
2835
uses: peaceiris/actions-gh-pages@v3
2936
with:
3037
github_token: ${{ secrets.GITHUB_TOKEN }}
3138
publish_dir: ./site
39+
publish_branch: gh-pages

0 commit comments

Comments
 (0)