Some checks failed
Build Eleventy Site / build (push) Failing after 2m5s
so that the built site can be copied to the document root for the site
44 lines
1.1 KiB
YAML
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
|