eolas/.github/workflows/publish-neuron.yml
2024-10-20 19:04:43 +01:00

33 lines
1 KiB
YAML

name: "Publish Neuron Site"
on:
push:
branches:
- master
jobs:
neuron:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build neuron site 🔧
run: |
mkdir -p .neuron/output && touch .neuron/output/.nojekyll
NEURON_DIR=$(find neuron -maxdepth 1 -type d -regex '.*/[a-f0-9-]\{36\}' | head -n 1)
if [ -n "$NEURON_DIR" ]; then
echo "Found Neuron directory: $NEURON_DIR"
NEURON_FILE=$(find "$NEURON_DIR" -name "*.md" | head -n 1)
if [ -n "$NEURON_FILE" ]; then
echo "Found Neuron file: $NEURON_FILE"
docker run -v $PWD:/notes sridca/neuron neuron gen --pretty-urls /notes
else
echo "No .md files found in $NEURON_DIR"
exit 1
fi
else
echo "No matching directory found in neuron/"
exit 1
fi
- name: Deploy to gh-pages 🚀
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .neuron/output/