Files
Documentation/.gitea/workflows/gitea-actions.yml
T
Shaz 4d647b9754
Build and deploy docusaurus site / build (push) Successful in 1m14s
oi
2026-03-06 01:36:22 +01:00

37 lines
1.2 KiB
YAML

name: Build and deploy docusaurus site
on:
push:
branches:
- main
jobs:
build:
runs-on: homelab
steps:
- name: Bootstrap git and node
run: |
command -v git >/dev/null && command -v node >/dev/null && node --version | grep -q "v20" && exit 0
apt-get update -qq
apt-get install -y -qq git curl
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y -qq nodejs
git --version && node --version && npm --version
- name: Checkout repository
run: |
git clone http://oauth2:${{ gitea.token }}@192.168.1.18:3000/${{ gitea.repository }}.git .
git checkout ${{ gitea.sha }}
- name: Build Docusaurus site
run: cd docs-site && npm ci && npm run build
- name: Deploy to /srv/ssd/www/docusaurus
run: |
echo "hostname=$(hostname) user=$(whoami)"
mount | grep docusaurus || echo "WARNING: no docusaurus bind-mount found, running in wrong container"
mkdir -p /srv/www/docusaurus
rm -rf /srv/www/docusaurus/*
cp -r docs-site/build/. /srv/www/docusaurus/
echo "Deployed:"
ls /srv/www/docusaurus | head -20