62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
image: ubuntu/24.04
|
|
packages:
|
|
- imagemagick
|
|
# - npm
|
|
- rsync
|
|
- ruby
|
|
sources:
|
|
- https://git.sr.ht/~dce/davideisinger.com
|
|
secrets:
|
|
- 9b440bf5-2785-4ab9-9584-124b9ecd04c4 # decryption key
|
|
- bea2ece1-a780-44cc-b74b-e96c484f0daf # server IP
|
|
- a1f811ce-156d-4083-9d6e-110da705a286 # deploy key
|
|
triggers:
|
|
- action: email
|
|
condition: failure
|
|
to: david@davideisinger.com
|
|
environment:
|
|
HUGO_VERSION: 0.160.1
|
|
tasks:
|
|
# Install Hugo + Bundler, and make all subsequent steps cd into site root
|
|
- setup: |
|
|
wget --quiet https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
|
|
sudo apt install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb
|
|
sudo gem install bundler
|
|
echo 'cd davideisinger.com' >> ~/.buildenv
|
|
|
|
# Spellcheck Markdown files
|
|
# - spelling: |
|
|
# npx cspell "content/**/*.md"
|
|
|
|
# Diff RSS template against Hugo default, make sure only differences are intentional
|
|
- rss: |
|
|
curl -s https://raw.githubusercontent.com/gohugoio/hugo/refs/tags/v$HUGO_VERSION/tpl/tplimpl/embedded/templates/rss.xml \
|
|
| diff - ./themes/v2/layouts/_default/rss.xml \
|
|
| wc -l \
|
|
| grep 7
|
|
|
|
# Start Ruby server for dithering images
|
|
- dither: |
|
|
true
|
|
|
|
# Build site
|
|
- hugo: |
|
|
./bin/build
|
|
|
|
# Sync files to production server
|
|
- deploy: |
|
|
if [ "$(git rev-parse main)" != "$(git rev-parse HEAD)" ]; then \
|
|
complete-build; \
|
|
fi
|
|
set +x
|
|
export SERVER_IP=$(cat ~/server_ip.txt)
|
|
rsync \
|
|
--rsh="ssh -o StrictHostKeyChecking=no" \
|
|
-v \
|
|
-r \
|
|
--delete \
|
|
public/ \
|
|
www-data@$SERVER_IP:/var/www/davideisinger.com \
|
|
2>/dev/null
|
|
set -x
|