devon.lol/.forgejo/workflows/build-eleventy.yaml
Devon Campbell 23b603f55f
Some checks failed
Build Eleventy Site / build (push) Failing after 1m45s
Bind media volume on runner container
so that the built site can be copied to the document root for the site
2025-03-03 22:33:58 -05:00

39 lines
970 B
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: 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