blog/.forgejo/workflows/deploy.yaml
Sergio Durigan Junior 2c20250a7c
Some checks failed
/ deploy (push) Failing after 2m7s
Very hacky way to add the Plausible snippet
2024-09-15 17:02:17 -04:00

42 lines
1.4 KiB
YAML

on:
push:
branches:
- master
jobs:
deploy:
runs-on: debian-testing-slim
steps:
- name: Update system and install deps
env:
DEBIAN_FRONTEND=noninteractive
run: |
apt-get update
apt-get install -y hugo rsync openssh-client nodejs
- name: Clone repository
uses: https://gitea.com/actions/checkout@v4
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Add Plausible snippet (hacky)
run: |
sed -i 's,^<head>$,<head>\n\t<script defer data-domain="blog.sergiodj.net" src="https://plausible.sergiodj.net/js/script.js"></script>,' themes/binario/layouts/_default/baseof.html
- name: Setup SSH
env:
SSH_KEY: ${{ secrets.ssh_key }}
run: |
mkdir ~/.ssh/
printf '%s\n' "${SSH_KEY}" > ~/.ssh/id_rsa
chmod 0700 ~/.ssh
chmod 0700 ~/.ssh/id_rsa
# - name: Prepare modules
# run: |
# /usr/bin/hugo mod init github.com/divinerites/plausible-hugo
# /usr/bin/hugo mod get
- name: Run Hugo
run: /usr/bin/hugo --logLevel info
- name: Run rsync
env:
SSH_PORT: ${{ secrets.ssh_port }}
run: /usr/bin/rsync --verbose --compress --archive --recursive --progress --checksum --delete --rsh="/usr/bin/ssh -4 -p ${SSH_PORT} -o StrictHostKeyChecking=no" public/ blog@sergiodj.net:.