This commit is contained in:
@@ -8,12 +8,20 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: homelab
|
runs-on: homelab
|
||||||
container:
|
|
||||||
image: node:20-bullseye
|
|
||||||
volumes:
|
|
||||||
- /srv/ssd/www/docusaurus:/deploy
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Bootstrap Node 20
|
||||||
|
run: |
|
||||||
|
if command -v node >/dev/null 2>&1 && node --version | grep -q "^v20"; then
|
||||||
|
echo "Node 20 already installed: $(node --version)"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install -y -qq curl
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||||
|
apt-get install -y -qq nodejs
|
||||||
|
node --version && npm --version
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
run: |
|
||||||
git clone http://oauth2:${{ gitea.token }}@192.168.1.18:3000/${{ gitea.repository }}.git .
|
git clone http://oauth2:${{ gitea.token }}@192.168.1.18:3000/${{ gitea.repository }}.git .
|
||||||
@@ -24,8 +32,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
ls /deploy || { echo "ERROR: /deploy is not mounted"; exit 1; }
|
echo "=== Running as: $(whoami) on $(hostname) ==="
|
||||||
rm -rf /deploy/*
|
echo "=== Mounts containing 'docusaurus': ==="
|
||||||
cp -r docs-site/build/. /deploy/
|
mount | grep docusaurus || echo "(none — host mode is NOT active)"
|
||||||
echo "Done. Files deployed:"
|
rm -rf /srv/www/docusaurus/*
|
||||||
ls /deploy
|
cp -r docs-site/build/. /srv/www/docusaurus/
|
||||||
|
echo "=== Deployed files: ==="
|
||||||
|
ls /srv/www/docusaurus
|
||||||
|
|||||||
Reference in New Issue
Block a user