2025-02-07 21:39:15 -05:00
|
|
|
name: Build Eleventy Site
|
|
|
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
2025-03-03 19:12:50 -05:00
|
|
|
env:
|
|
|
|
|
WEBMENTIONSIO_TOKEN: ${{ secrets.WEBMENTIONSIO_TOKEN }}
|
2025-03-04 19:31:45 -05:00
|
|
|
TZ: America/New_York
|
2025-03-03 19:12:50 -05:00
|
|
|
|
2025-02-07 21:39:15 -05:00
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
container:
|
|
|
|
|
image: node:18
|
2025-03-03 22:33:58 -05:00
|
|
|
volumes:
|
2026-06-08 21:09:24 -04:00
|
|
|
# This is the path mounted in the Forgejo stack's docker-compose
|
|
|
|
|
- /sites:/sites
|
2025-02-07 21:39:15 -05:00
|
|
|
|
|
|
|
|
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
|
2025-03-03 22:15:14 -05:00
|
|
|
run: npm run build
|
2025-02-07 21:39:15 -05:00
|
|
|
|
|
|
|
|
- name: Move built site
|
|
|
|
|
run: |
|
2026-06-08 23:28:41 -04:00
|
|
|
set -e # Exit on any error
|
2025-03-03 22:33:58 -05:00
|
|
|
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
2025-03-03 22:15:14 -05:00
|
|
|
echo "Deploying production..."
|
2026-06-08 21:09:24 -04:00
|
|
|
rm -rf /sites/devon.lol && mkdir /sites/devon.lol && mv dist/* /sites/devon.lol
|
2025-02-07 21:39:15 -05:00
|
|
|
echo "Running webmention..."
|
2025-03-04 19:39:46 -05:00
|
|
|
echo "ls dist:"
|
|
|
|
|
ls dist
|
2026-06-08 21:09:24 -04:00
|
|
|
npx webmention /sites/devon.lol/feed.xml --send
|
2025-02-07 21:39:15 -05:00
|
|
|
else
|
2025-03-03 22:15:14 -05:00
|
|
|
echo "Deploying staging..."
|
2026-06-08 21:09:24 -04:00
|
|
|
rm -rf /sites/staging.devon.lol && mkdir /sites/staging.devon.lol && mv dist/* /sites/staging.devon.lol
|
2025-02-07 21:39:15 -05:00
|
|
|
fi
|