devon.lol/.forgejo/workflows/build-eleventy.yaml
Devon Campbell 3c96362323
Some checks failed
Build Eleventy Site / build (push) Failing after 1m57s
Bind media volume on runner container
so that the built site can be copied to the document root for the site
2025-03-04 17:55:28 -05:00

44 lines
1.1 KiB
YAML

name: Build Eleventy Site
on: [push]
env:
WEBMENTIONSIO_TOKEN: ${{ secrets.WEBMENTIONSIO_TOKEN }}
jobs:
build:
runs-on: docker
container:
image: node:18
volumes:
- /media/Media:/media/Media
steps:
- name: Checkout code
run: |
git clone ${{ github.server_url }}/${{ github.repository }} .
git fetch origin ${{ github.ref }}
git checkout FETCH_HEAD
- name: Install dependencies
run: npm install
- name: Build Eleventy site
run: npm run build
- name: Debugging step
run: |
echo '/media: `ls /media`'
echo '/media/Media: `ls /media/Media`'
- name: Move built site
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "Deploying production..."
mv dist/* /media/Media/sites/devon.lol
echo "Running webmention..."
webmention dist/feed.xml --send
else
echo "Deploying staging..."
mv dist/* /media/Media/sites/staging.devon.lol
fi