devon.lol/.forgejo/workflows/build-eleventy.yaml
Devon Campbell 40c9697eff
All checks were successful
Build Eleventy Site / build (push) Successful in 1m21s
Exit on any failed command
2026-06-08 23:28:41 -04:00

44 lines
1.2 KiB
YAML

name: Build Eleventy Site
on: [push]
env:
WEBMENTIONSIO_TOKEN: ${{ secrets.WEBMENTIONSIO_TOKEN }}
TZ: America/New_York
jobs:
build:
runs-on: docker
container:
image: node:18
volumes:
# This is the path mounted in the Forgejo stack's docker-compose
- /sites:/sites
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: |
set -e # Exit on any error
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "Deploying production..."
rm -rf /sites/devon.lol && mkdir /sites/devon.lol && mv dist/* /sites/devon.lol
echo "Running webmention..."
echo "ls dist:"
ls dist
npx webmention /sites/devon.lol/feed.xml --send
else
echo "Deploying staging..."
rm -rf /sites/staging.devon.lol && mkdir /sites/staging.devon.lol && mv dist/* /sites/staging.devon.lol
fi