Compare commits
2 Commits
7a50a7541a
...
2ca66ed400
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ca66ed400 | ||
|
|
4d0c65dcef |
14
.build.yml
14
.build.yml
@@ -37,11 +37,19 @@ tasks:
|
|||||||
|
|
||||||
# Start Ruby server for dithering images
|
# Start Ruby server for dithering images
|
||||||
- dither: |
|
- dither: |
|
||||||
true
|
cd bin/dither
|
||||||
|
sudo bundle install
|
||||||
|
ROOT=~/davideisinger.com/content \
|
||||||
|
KEY=~/secret.key \
|
||||||
|
bundle exec rackup -p 4567 -D
|
||||||
|
|
||||||
# Build site
|
# Build site
|
||||||
- hugo: |
|
- hugo: |
|
||||||
./bin/build
|
HUGO_PARAMS_GIT_COMMIT=$(git rev-parse HEAD) \
|
||||||
|
DITHER_SERVER=http://localhost:4567 \
|
||||||
|
hugo --minify
|
||||||
|
find public -name "*.enc" -type f -delete
|
||||||
|
find public/elsewhere -name "*.gmi" -type f -delete
|
||||||
|
|
||||||
# Sync files to production server
|
# Sync files to production server
|
||||||
- deploy: |
|
- deploy: |
|
||||||
@@ -55,7 +63,7 @@ tasks:
|
|||||||
-v \
|
-v \
|
||||||
-r \
|
-r \
|
||||||
--delete \
|
--delete \
|
||||||
public/ \
|
public/* \
|
||||||
www-data@$SERVER_IP:/var/www/davideisinger.com \
|
www-data@$SERVER_IP:/var/www/davideisinger.com \
|
||||||
2>/dev/null
|
2>/dev/null
|
||||||
set -x
|
set -x
|
||||||
|
|||||||
@@ -33,11 +33,7 @@ jobs:
|
|||||||
printf '%s' "$SECRET_KEY" > secret.key
|
printf '%s' "$SECRET_KEY" > secret.key
|
||||||
|
|
||||||
- name: Verify RSS template diff
|
- name: Verify RSS template diff
|
||||||
run: |
|
run: ./bin/check-rss-template
|
||||||
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
|
|
||||||
|
|
||||||
- name: Build site
|
- name: Build site
|
||||||
run: ./bin/build
|
run: ./bin/build
|
||||||
|
|||||||
29
bin/check-rss-template
Executable file
29
bin/check-rss-template
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||||
|
tmp_dir=$(mktemp -d)
|
||||||
|
trap 'rm -rf "${tmp_dir}"' EXIT
|
||||||
|
|
||||||
|
hugo_version="${HUGO_VERSION:?HUGO_VERSION must be set}"
|
||||||
|
upstream_template="${tmp_dir}/rss.xml"
|
||||||
|
diff_output="${tmp_dir}/rss.diff"
|
||||||
|
|
||||||
|
curl -fsSL "https://raw.githubusercontent.com/gohugoio/hugo/refs/tags/v${hugo_version}/tpl/tplimpl/embedded/templates/rss.xml" \
|
||||||
|
-o "${upstream_template}"
|
||||||
|
|
||||||
|
set +e
|
||||||
|
diff "${upstream_template}" "${repo_root}/themes/v2/layouts/_default/rss.xml" >"${diff_output}"
|
||||||
|
diff_status=$?
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [[ "${diff_status}" -gt 1 ]]; then
|
||||||
|
exit "${diff_status}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
line_count=$(wc -l <"${diff_output}" | tr -d ' ')
|
||||||
|
if [[ "${line_count}" != "7" ]]; then
|
||||||
|
echo "Unexpected RSS template diff line count: ${line_count}" >&2
|
||||||
|
cat "${diff_output}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user