All checks were successful
Build Eleventy Site / build (push) Successful in 1m51s
so that the built site can be copied to the document root for the site
39 lines
1.1 KiB
YAML
39 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: Move built site
|
|
run: |
|
|
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
|
echo "Deploying production..."
|
|
rm -rf /media/Media/sites/devon.lol && mkdir /media/Media/sites/devon.lol && mv dist/* /media/Media/sites/devon.lol
|
|
echo "Running webmention..."
|
|
webmention dist/feed.xml --send
|
|
else
|
|
echo "Deploying staging..."
|
|
rm -rf /media/Media/sites/staging.devon.lol && mkdir /media/Media/sites/staging.devon.lol && mv dist/* /media/Media/sites/staging.devon.lol
|
|
fi
|