This commit is contained in:
@@ -8,12 +8,20 @@ on:
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: homelab
|
||||
container:
|
||||
image: node:20-bullseye
|
||||
volumes:
|
||||
- /srv/ssd/www/docusaurus:/deploy
|
||||
|
||||
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
|
||||
run: |
|
||||
git clone http://oauth2:${{ gitea.token }}@192.168.1.18:3000/${{ gitea.repository }}.git .
|
||||
@@ -24,8 +32,10 @@ jobs:
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
ls /deploy || { echo "ERROR: /deploy is not mounted"; exit 1; }
|
||||
rm -rf /deploy/*
|
||||
cp -r docs-site/build/. /deploy/
|
||||
echo "Done. Files deployed:"
|
||||
ls /deploy
|
||||
echo "=== Running as: $(whoami) on $(hostname) ==="
|
||||
echo "=== Mounts containing 'docusaurus': ==="
|
||||
mount | grep docusaurus || echo "(none — host mode is NOT active)"
|
||||
rm -rf /srv/www/docusaurus/*
|
||||
cp -r docs-site/build/. /srv/www/docusaurus/
|
||||
echo "=== Deployed files: ==="
|
||||
ls /srv/www/docusaurus
|
||||
|
||||
Reference in New Issue
Block a user