diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 603ef90..216735d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -44,15 +44,14 @@ jobs: sudo apt update sudo apt install -y rustc cargo - - name: Build + - name: Build Website-Toots run: | cd content/toots/.scripts cargo build --release - - name: Generate Hugo Markdown for Toots + - name: Pre-build script run: | - cd content/toots/.scripts - ./target/release/generate_md + ./build.sh - name: Build Hugo Website id: build diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..0a87820 --- /dev/null +++ b/build.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +# Generate toot markdown files + +pushd content/toots/.scripts > /dev/null + +generate_exe="./target/release/generate_md" + +# Check if the file exists and is executable +if [ -e "$generate_exe" ] && [ -x "$generate_exe" ]; then + echo "The file '$file_path' exists and is executable." + ./target/release/generate_md +else + echo "The executable '$generate_exe' does not exist." + echo "Perhaps run cargo build in 'content/toots/.scripts'?" +fi + +popd > /dev/null